From bfa90c5b31db38bfe5067150725a069cb1bc970b Mon Sep 17 00:00:00 2001 From: Vincent Guillet Date: Fri, 28 Nov 2025 17:03:04 +0000 Subject: [PATCH] Update client/Dockerfile --- client/Dockerfile | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/client/Dockerfile b/client/Dockerfile index 9a904d9..a5735fb 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,25 +1,32 @@ -# ---------- Stage 1 : build Angular ---------- -FROM node:20-alpine AS build +# ====================== +# 1) Build Angular +# ====================== +FROM node:20 AS build WORKDIR /app +# Dépendances COPY package*.json ./ RUN npm ci +# Sources COPY . . -# Build Angular en mode prod +# Build prod Angular (utilise angular.json -> outputPath: dist/client) RUN npm run build -# ---------- Stage 2 : Nginx pour servir le build ---------- -FROM nginx:alpine +# ====================== +# 2) NGINX final +# ====================== +FROM nginx:stable -# Notre conf Nginx custom +# On remplace complètement le contenu par le build Angular +# ⚠️ IMPORTANT : Angular 18 + builder "application" -> dist/client (pas /browser) +COPY --from=build /app/dist/client/ /usr/share/nginx/html/ + +# Conf Nginx custom (SPA + proxy /ps) COPY nginx.conf /etc/nginx/conf.d/default.conf -# Copie du build Angular -COPY --from=build /app/dist/client /usr/share/nginx/html - EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file