| # Use a lightweight Python base. Hugging Face Spaces supports Docker deployment. | |
| FROM python:3.10-slim | |
| # Install system dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| curl \ | |
| git \ | |
| gcc \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxrender1 \ | |
| libxext6 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Set working dir | |
| WORKDIR /app | |
| # Copy requirements and install | |
| COPY requirements.txt /app/requirements.txt | |
| RUN pip install --no-cache-dir -r /app/requirements.txt | |
| # Copy app | |
| COPY . /app | |
| # Expose port used by Streamlit (HF Spaces will handle binding) | |
| ENV PORT=7860 | |
| ENV STREAMLIT_SERVER_ENABLECORS=false | |
| ENV STREAMLIT_SERVER_HEADLESS=true | |
| ENV STREAMLIT_SERVER_PORT=${PORT} | |
| # Run Streamlit | |
| CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"] |