From bfaca86a290b76cafe2cef58b173c91bf22770b2 Mon Sep 17 00:00:00 2001 From: Vincent Guillet Date: Fri, 21 Nov 2025 14:43:26 +0000 Subject: [PATCH] Update client/Dockerfile --- client/Dockerfile | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/client/Dockerfile b/client/Dockerfile index 3a1809e..2929826 100644 --- a/client/Dockerfile +++ b/client/Dockerfile @@ -1,14 +1,27 @@ - -# Dockerfile pour développement/demo Angular avec ng serve -FROM node:20 +# Étape 1 : build Angular en mode production +FROM node:20 AS build WORKDIR /app +# Install dépendances COPY package*.json ./ RUN npm install +# Copie du code COPY . . -EXPOSE 4200 +# Build Angular en prod (utilise environment.prod.ts + fileReplacements) +RUN npm run build -- --configuration production -CMD ["npx", "ng", "serve", "--host", "0.0.0.0"] +# Étape 2 : image finale Nginx pour servir les fichiers statiques +FROM nginx:alpine + +# Copie du build Angular vers Nginx +COPY --from=build /app/dist/client /usr/share/nginx/html + +# Optionnel : conf Nginx custom (SPA, 404 → index.html, etc.) +# COPY nginx.conf /etc/nginx/conf.d/default.conf + +EXPOSE 80 + +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file