FROM python:3.11-slim # not using 3.13 in docker because slim image had some issues with it # 3.11 is stable and the packages all work fine with it WORKDIR /app # copy requirements first so docker layer caching works # (this layer only rebuilds if requirements.txt changes) COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # copy everything else COPY . . # expose the port the server runs on EXPOSE 7860 # HuggingFace Spaces uses port 7860 # PORT env var is set by HF, we fall back to 7860 if not set ENV PORT=7860 # this works, don't touch it CMD ["python", "-m", "uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "7860"]