Spaces:
Running
Running
| FROM python:3.13.5-slim | |
| # Avoid interactive tzdata prompts and keep logs unbuffered | |
| ENV DEBIAN_FRONTEND=noninteractive \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| # Make Streamlit write to a writable place (fixes '/.streamlit' permission error) | |
| HOME=/app \ | |
| XDG_CONFIG_HOME=/app/.config \ | |
| STREAMLIT_CONFIG_DIR=/app/.streamlit \ | |
| STREAMLIT_BROWSER_GATHER_USAGE_STATS=false | |
| WORKDIR /app | |
| # Minimal OS deps you actually need (curl for healthcheck, build-essential for any wheels that need compile) | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| curl \ | |
| build-essential \ | |
| ffmpeg \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Pre-create streamlit config dir (in case Streamlit tries to write during boot) | |
| RUN mkdir -p /app/.streamlit | |
| # Install Python deps first to leverage Docker layer cache | |
| COPY requirements.txt ./ | |
| RUN pip install -r requirements.txt | |
| # Now add the rest of the app | |
| COPY . . | |
| EXPOSE 8501 | |
| # Healthcheck (streamlit exposes this) | |
| HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health | |
| # Run Streamlit | |
| ENTRYPOINT ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0", "--server.enableXsrfProtection=false"] | |