Update client/Dockerfile
This commit is contained in:
@@ -1,25 +1,18 @@
|
||||
# Étape 1 : build Angular en prod
|
||||
# Build Angular
|
||||
FROM node:20 AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
|
||||
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
|
||||
RUN rm -rf /usr/share/nginx/html/*
|
||||
# NGINX final
|
||||
FROM nginx:stable
|
||||
|
||||
# ⚠️ Important : copier le CONTENU de dist/client et pas le dossier lui-même
|
||||
COPY --from=build /app/dist/client/ /usr/share/nginx/html
|
||||
COPY --from=build /app/dist/client/browser /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
|
||||
CMD ["nginx", "-g", "daemon off;"]
|
||||
EXPOSE 80
|
||||
Reference in New Issue
Block a user