2026-01-06 13:10:06 +00:00
|
|
|
# ==== frontend/Dockerfile (production) ====
|
|
|
|
|
|
|
|
|
|
# ---------- Builder ----------
|
2026-01-06 12:51:40 +00:00
|
|
|
FROM node:20-alpine AS builder
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
COPY package*.json ./
|
2026-01-06 13:10:06 +00:00
|
|
|
RUN npm ci # clean install, respects lockfile
|
2026-01-06 12:51:40 +00:00
|
|
|
|
|
|
|
|
COPY . .
|
2026-01-06 13:10:06 +00:00
|
|
|
RUN npm run build # Vite outputs to ./dist
|
|
|
|
|
|
|
|
|
|
# ---------- Runtime ----------
|
|
|
|
|
FROM nginx:stable-alpine AS runtime
|
2026-01-06 12:51:40 +00:00
|
|
|
|
2026-01-06 13:10:06 +00:00
|
|
|
# Copy the compiled assets from the builder stage
|
2026-01-06 12:51:40 +00:00
|
|
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
2026-01-06 13:10:06 +00:00
|
|
|
|
2026-01-06 12:51:40 +00:00
|
|
|
EXPOSE 80
|
2026-01-06 13:10:06 +00:00
|
|
|
CMD ["nginx", "-g", "daemon off;"]
|