Spaces:
Sleeping
Sleeping
| # Stage 1: Build frontend | |
| FROM node:18-alpine AS frontend-build | |
| WORKDIR /app/frontend | |
| COPY frontend/package*.json ./ | |
| RUN npm install | |
| COPY frontend/ ./ | |
| RUN npm run build | |
| # Stage 2: Python backend | |
| FROM python:3.11-slim | |
| WORKDIR /app | |
| # Install backend deps | |
| COPY backend/requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy backend | |
| COPY backend/ ./backend/ | |
| # Copy built frontend | |
| COPY --from=frontend-build /app/frontend/dist ./frontend/dist | |
| # Expose port for Hugging Face | |
| EXPOSE 7860 | |
| # Start server | |
| CMD ["uvicorn", "backend.main:app", "--host", "0.0.0.0", "--port", "7860"] | |