FROM python:3.10-slim WORKDIR /app # Copy and install dependencies first (better Docker cache) COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy backend code COPY app.py . # HuggingFace Spaces requires port 7860 EXPOSE 7860 # Run Flask via gunicorn CMD ["gunicorn", "--bind", "0.0.0.0:7860", "--timeout", "120", "app:app"]