# =========================================================================== # Learn Pathophysiology — WC3 Edition # Multi-stage build: Vue frontend + FastAPI backend # Deploy: HuggingFace Spaces (Docker SDK) # =========================================================================== # ---------- Stage 1: Build Vue Frontend ---------- FROM node:20-slim AS frontend-build WORKDIR /build COPY frontend/package.json frontend/package-lock.json* ./ RUN npm install COPY frontend/ ./ # Skip vue-tsc type checking (storybook files have TS errors) — just run vite build RUN npx vite build # Output goes to /build/dist/ # ---------- Stage 2: Python Backend + Serve Static ---------- FROM python:3.11-slim WORKDIR /app # Install Python deps COPY backend/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Copy backend code COPY backend/ ./ # Copy built frontend from stage 1 COPY --from=frontend-build /build/dist ./static/ # Copy chroma_db (must be present in docker build context) COPY chroma_db/ ./chroma_db/ # Environment ENV PORT=7860 ENV CHROMA_DIR=/app/chroma_db # Auth (set via HuggingFace Spaces secrets) # ENV GOOGLE_CLIENT_ID=... # ENV JWT_SECRET=... # ENV GEMINI_API_KEY=... EXPOSE 7860 CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "4"]