Spaces:
Running
Running
| FROM python:3.12-slim | |
| # Pull the uv binary from the official release image — no pip bootstrap needed. | |
| COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv | |
| WORKDIR /app | |
| # Install Python dependencies first (cache-friendly layer). | |
| COPY backend/requirements.txt ./backend/requirements.txt | |
| RUN uv pip install --system --no-cache -r backend/requirements.txt | |
| # App code + the static site it serves. The config module derives the repo | |
| # root from its own path, so this backend/ + frontend/ layout must be kept. | |
| COPY backend/ ./backend/ | |
| COPY frontend/ ./frontend/ | |
| ENV PYTHONUNBUFFERED=1 | |
| # HuggingFace Spaces (Docker SDK) reaches the container on this port. | |
| EXPOSE 7860 | |
| # --app-dir puts backend/ on sys.path so the `app` package resolves. | |
| CMD ["uvicorn", "app.main:app", "--app-dir", "backend", "--host", "0.0.0.0", "--port", "7860"] | |