| # Base Python image | |
| FROM python:3.10-slim | |
| # Set working directory | |
| WORKDIR /code | |
| # Copy dependencies first for caching | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app folder (includes main.py + best_model.h5) | |
| COPY ./app ./app | |
| # Set working directory to app | |
| WORKDIR /code/app | |
| # Expose Hugging Face Space port | |
| EXPOSE 7860 | |
| # Start FastAPI app | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |