- Replace serve with nginx for proper reverse proxy - /api/* proxied to backend:8000, /wizard/* proxied to wizard:8080 - Eliminates CORS issues (same-origin requests) - Fixes SPA fallback returning 200 for API routes (was hiding backend-down state) - Add null guards on Object.entries for dashboard stats - Remove VITE_API_BASE/VITE_WIZARD_PORT build args (no longer needed)
16 lines
418 B
Docker
16 lines
418 B
Docker
# Build stage
|
|
FROM node:20-alpine AS build
|
|
WORKDIR /app
|
|
COPY package.json package-lock.json* ./
|
|
RUN npm install
|
|
COPY . .
|
|
# API and wizard are proxied via nginx — no VITE_ env vars needed
|
|
RUN npm run build
|
|
|
|
# Production stage — nginx with reverse proxy
|
|
FROM nginx:alpine
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
EXPOSE 3000
|
|
CMD ["nginx", "-g", "daemon off;"]
|