Update client/Dockerfile

This commit is contained in:
2025-11-22 16:35:38 +00:00
parent 05c998be1f
commit 6b6ef1cbab

View File

@@ -1,25 +1,18 @@
# Étape 1 : build Angular en prod # Build Angular
FROM node:20 AS build FROM node:20 AS build
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm install RUN npm install
COPY . . COPY . .
RUN npm run build -- --configuration production RUN npm run build
# Étape 2 : Nginx pour servir le build
FROM nginx:1.29-alpine
# On nettoie l'html par défaut # NGINX final
RUN rm -rf /usr/share/nginx/html/* FROM nginx:stable
# ⚠️ Important : copier le CONTENU de dist/client et pas le dossier lui-même COPY --from=build /app/dist/client/browser /usr/share/nginx/html
COPY --from=build /app/dist/client/ /usr/share/nginx/html COPY nginx.conf /etc/nginx/conf.d/default.conf
# (Optionnel) conf SPA perso
# COPY nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80 EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]