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
|
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
|
EXPOSE 80
|
||||||
# COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
|
|
||||||
EXPOSE 80
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
||||||
Reference in New Issue
Block a user