forked from mrwadams/stride-gpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.ui
More file actions
34 lines (23 loc) · 1.26 KB
/
Copy pathDockerfile.ui
File metadata and controls
34 lines (23 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# Streamlit web UI image for STRIDE-GPT.
# The CLI is published to PyPI (`pip install stride-gpt`); no separate CLI image.
FROM python:3.12-slim@sha256:090ba77e2958f6af52a5341f788b50b032dd4ca28377d2893dcf1ecbdfdfe203
ENV PYTHONUNBUFFERED=1
ENV PIP_ROOT_USER_ACTION=ignore
RUN groupadd --gid 1000 appuser && \
useradd --uid 1000 --gid 1000 -ms /bin/bash appuser && \
pip install --no-cache-dir --upgrade pip && \
mkdir -p /home/appuser/.local/bin /home/appuser/.local/lib
EXPOSE 8501
WORKDIR /home/appuser
COPY --chown=appuser:appuser . /home/appuser
USER appuser
ENV PATH="$PATH:/home/appuser/.local/bin:/home/appuser/.local/lib:/home/appuser/venv/bin"
ENV VIRTUAL_ENV=/home/appuser/venv
RUN python -m venv ${VIRTUAL_ENV}
RUN ${VIRTUAL_ENV}/bin/pip install --no-cache-dir --upgrade pip && \
${VIRTUAL_ENV}/bin/pip install --no-cache-dir -r apps/web/requirements.txt && \
${VIRTUAL_ENV}/bin/pip check
HEALTHCHECK --interval=30s --timeout=5s --start-period=5s --retries=3 \
CMD python -c "import urllib.request, sys; sys.exit(0 if urllib.request.urlopen('http://localhost:8501/_stcore/health', timeout=4).status == 200 else 1)" || exit 1
ENTRYPOINT ["streamlit", "run", "apps/web/main.py", \
"--server.port=8501", "--server.address=0.0.0.0"]