25 lines
565 B
Docker
25 lines
565 B
Docker
# Étape 1 : build Angular en prod
|
|
FROM node:20 AS build
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package*.json ./
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
RUN npm run build -- --configuration production
|
|
|
|
# É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/*
|
|
|
|
# ⚠️ Important : copier le CONTENU de dist/client et pas le dossier lui-même
|
|
COPY --from=build /app/dist/client/ /usr/share/nginx/html
|
|
|
|
# (Optionnel) conf SPA perso
|
|
# COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"] |