FROM python:3.11-slim # Set working directory WORKDIR /app # Install dependencies first (layer caching) COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy project files COPY . . # HuggingFace Spaces expects port 7860 EXPOSE 7860 # Start FastAPI server CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860"]