Spaces:
Sleeping
Sleeping
| # Use Python 3.9.11 slim as base | |
| FROM python:3.9.11-slim | |
| WORKDIR /app | |
| # Install only what you need for build/runtime | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| curl \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Copy all sources at repo root into image | |
| COPY requirements.txt ./requirements.txt | |
| COPY . . | |
| # Put project root on PYTHONPATH | |
| ENV PYTHONPATH=/app | |
| # Install python dependencies | |
| RUN python -m pip install --upgrade pip setuptools wheel \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # Spaces sets $PORT; default locally to 8501 | |
| ENV PORT=8501 | |
| EXPOSE 8501 | |
| HEALTHCHECK CMD curl --fail http://localhost:${PORT}/_stcore/health || exit 1 | |
| # Use sh so $PORT expands at runtime | |
| ENTRYPOINT ["/bin/sh", "-c", "streamlit run streamlit_app.py --server.port ${PORT} --server.address 0.0.0.0"] | |