Spaces:
Sleeping
Sleeping
| # Build React frontend | |
| FROM node:20-slim AS frontend-build | |
| WORKDIR /app/frontend | |
| COPY frontend/package*.json ./ | |
| RUN npm ci | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| # Python backend | |
| FROM python:3.11-slim | |
| WORKDIR /app/backend | |
| COPY backend/requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY backend/ ./ | |
| # Copy built frontend into backend/static/ (served by FastAPI) | |
| COPY --from=frontend-build /app/frontend/dist ./static/ | |
| # Logs directory (ephemeral — resets on container restart) | |
| RUN mkdir -p logs | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"] | |