Spaces:
Running
Running
| # โโ Stage 1 : Build SvelteKit โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| FROM node:20-slim AS frontend-builder | |
| WORKDIR /app/frontend | |
| COPY frontend/package*.json ./ | |
| RUN npm ci --prefer-offline | |
| COPY frontend/ ./ | |
| RUN npm run build # โ frontend/build/ | |
| # โโ Stage 2 : Runtime Python โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Deps Python | |
| COPY backend/requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Code backend | |
| COPY backend/ ./backend/ | |
| # Build frontend statique (servi par FastAPI) | |
| COPY --from=frontend-builder /app/frontend/build ./frontend/build | |
| # HF Spaces exige le port 7860 | |
| EXPOSE 7860 | |
| WORKDIR /app/backend | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |