| FROM python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| STREAMLIT_SERVER_HEADLESS=true \ | |
| STREAMLIT_SERVER_ADDRESS=0.0.0.0 \ | |
| STREAMLIT_SERVER_PORT=8501 \ | |
| STREAMLIT_BROWSER_GATHER_USAGE_STATS=false | |
| WORKDIR /app | |
| RUN addgroup --system app && adduser --system --ingroup app app | |
| COPY requirements.txt . | |
| RUN python -m pip install --no-cache-dir --upgrade pip \ | |
| && python -m pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| RUN chown -R app:app /app | |
| USER app | |
| EXPOSE 8501 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ | |
| CMD python scripts/check_http_health.py | |
| CMD ["python", "-m", "streamlit", "run", "app.py", "--server.address=0.0.0.0", "--server.port=8501", "--server.headless=true"] | |