Files
HarborForge.Frontend/Dockerfile
zhi a655e41822 fix: nginx reverse proxy for API/wizard, fix Object.entries null crash
- 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)
2026-03-11 09:43:06 +00:00

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;"]