# ── Stage 1: Build frontend ── FROM node:24-alpine AS frontend-build WORKDIR /app COPY frontend/package*.json ./ RUN npm install COPY frontend/ . RUN npm run build # ── Stage 2: Production ── FROM python:3.14-slim RUN apt-get update && \ apt-get install -y --no-install-recommends nginx && \ rm -rf /var/lib/apt/lists/* # Backend dependencies WORKDIR /app COPY backend/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Backend source COPY backend/ . # Frontend static files COPY --from=frontend-build /app/dist /usr/share/nginx/html # Nginx config COPY nginx.hf.conf /etc/nginx/conf.d/default.conf RUN rm -f /etc/nginx/sites-enabled/default # Startup script COPY start.sh /app/start.sh RUN chmod +x /app/start.sh EXPOSE 8080 CMD ["/app/start.sh"]