| # Use lightweight Python base | |
| FROM python:3.10-slim | |
| # Set workdir inside container | |
| WORKDIR /app | |
| # Copy requirements first (for caching layers) | |
| COPY requirements.txt . | |
| # Install system deps + python deps | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| && rm -rf /var/lib/apt/lists/* \ | |
| && pip install --no-cache-dir -r requirements.txt | |
| # Copy rest of the code | |
| COPY . . | |
| # Expose port for HF Spaces | |
| EXPOSE 7860 | |
| # Start FastAPI app with Uvicorn | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |