2026-01-06 13:10:06 +00:00
|
|
|
|
# ---------- Builder ----------
|
2026-01-06 12:51:40 +00:00
|
|
|
|
FROM node:20-alpine AS builder
|
|
|
|
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
COPY package*.json ./
|
2026-01-06 13:13:59 +00:00
|
|
|
|
RUN npm ci # install deps (no dev‑dependencies unless you need them)
|
2026-01-06 12:51:40 +00:00
|
|
|
|
COPY . .
|
2026-01-06 13:13:59 +00:00
|
|
|
|
RUN npm run build # Vite creates ./dist
|
2026-01-06 13:10:06 +00:00
|
|
|
|
|
|
|
|
|
|
# ---------- 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;"]
|