| FROM python:3.10-slim | |
| WORKDIR /app | |
| # System dependencies | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Python dependencies | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy source code and model artifacts | |
| COPY src/ ./src/ | |
| COPY model_output/ ./model_output/ | |
| # Expose port 7860 (Hugging Face Spaces default) | |
| EXPOSE 7860 | |
| # Start FastAPI server | |
| CMD ["uvicorn", "src.api:app", "--host", "0.0.0.0", "--port", "7860"] | |