# Stage 1: Build frontend FROM node:22-alpine AS frontend-builder WORKDIR /app/frontend COPY frontend/package*.json ./ RUN npm install COPY frontend/ ./ ARG VITE_BASE_PATH=/leopost-full ARG VITE_API_BASE=/leopost-full/api ENV VITE_BASE_PATH=$VITE_BASE_PATH ENV VITE_API_BASE=$VITE_API_BASE RUN npm run build # Stage 2: Python backend + frontend built FROM python:3.12-slim WORKDIR /app COPY backend/requirements.txt ./ RUN pip install --no-cache-dir -r requirements.txt COPY backend/ ./ COPY --from=frontend-builder /app/frontend/dist ./static EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--root-path", "/leopost-full"]