Update client/Dockerfile
This commit is contained in:
@@ -1,14 +1,27 @@
|
|||||||
|
# Étape 1 : build Angular en mode production
|
||||||
# Dockerfile pour développement/demo Angular avec ng serve
|
FROM node:20 AS build
|
||||||
FROM node:20
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install dépendances
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
|
# Copie du code
|
||||||
COPY . .
|
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;"]
|
||||||
Reference in New Issue
Block a user