From b15f09e60433cb9e400d2a70b74b501722a4b9fa Mon Sep 17 00:00:00 2001 From: Jamitz Date: Tue, 6 Jan 2026 13:10:06 +0000 Subject: [PATCH] update dockerfile --- frontend/Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 0122e99..6de8458 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,15 +1,20 @@ -# frontend/Dockerfile +# ==== frontend/Dockerfile (production) ==== + +# ---------- Builder ---------- FROM node:20-alpine AS builder WORKDIR /app COPY package*.json ./ -RUN npm ci # clean install, respects lockfile +RUN npm ci # clean install, respects lockfile COPY . . -RUN npm run build # produces ./dist +RUN npm run build # Vite outputs to ./dist -# ---- Runtime image (optional) ---- -FROM nginx:stable-alpine +# ---------- Runtime ---------- +FROM nginx:stable-alpine AS runtime + +# Copy the compiled assets from the builder stage COPY --from=builder /app/dist /usr/share/nginx/html + EXPOSE 80 -CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file +CMD ["nginx", "-g", "daemon off;"]