| FROM python:3.9-slim |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| build-essential \ |
| curl \ |
| git \ |
| fonts-liberation \ |
| libgl1 \ |
| libglx-mesa0 \ |
| mesa-utils \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| WORKDIR /app |
|
|
| |
| RUN adduser --disabled-password --gecos '' streamlit-user |
| RUN chown -R streamlit-user:streamlit-user /app |
|
|
| USER streamlit-user |
| ENV HOME=/app |
| ENV PATH="/app/.local/bin:${PATH}" |
|
|
| COPY requirements.txt ./ |
| RUN pip3 install --user -r requirements.txt |
|
|
| RUN mkdir -p .streamlit |
| COPY .streamlit/ ./.streamlit/ |
| COPY src/ ./src/ |
|
|
| ENV STREAMLIT_SERVER_HEADLESS=true |
| ENV STREAMLIT_SERVER_ENABLECORS=false |
| ENV STREAMLIT_SERVER_PORT=7860 |
| ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0 |
|
|
| EXPOSE 7860 |
|
|
| HEALTHCHECK CMD curl --fail http://localhost:7860/_stcore/health || exit 1 |
|
|
| ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py"] |
|
|