| FROM python:3.10-slim | |
| WORKDIR /app | |
| # Set Hugging Face cache | |
| ENV HF_HOME=/app/hf_cache | |
| RUN mkdir -p /app/hf_cache && chmod -R 777 /app/hf_cache | |
| # Install Git and cleanup | |
| RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | |
| # Install Python packages | |
| COPY requirements.txt . | |
| RUN pip install --upgrade pip && pip install -r requirements.txt | |
| # Copy code | |
| COPY main.py . | |
| # ✅ Run with main.py, and port 7860 (required by Hugging Face) | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |