Spaces:
Sleeping
Sleeping
| # --- Stage 1: build frontend (Vite/React) --- | |
| FROM node:20-alpine AS frontend | |
| WORKDIR /fe | |
| COPY clarity-enhancer-main/ ./clarity-enhancer-main/ | |
| WORKDIR /fe/clarity-enhancer-main | |
| RUN npm ci | |
| RUN npm run build | |
| # --- Stage 2: backend (Flask) --- | |
| FROM python:3.9-slim | |
| WORKDIR /app | |
| # Copy backend repo | |
| COPY . . | |
| # Copy built frontend into Flask static folder | |
| RUN mkdir -p /app/static/clarity | |
| COPY --from=frontend /fe/clarity-enhancer-main/dist/ /app/static/clarity/ | |
| # Install Python deps | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| ENV PORT=7860 | |
| CMD ["gunicorn", "-b", "0.0.0.0:7860", "app:app"] | |