32 lines
710 B
Docker
32 lines
710 B
Docker
# Stage 1: Build de l'application Angular
|
|
FROM node:20-alpine AS build
|
|
|
|
WORKDIR /app
|
|
|
|
# Copier les fichiers de dépendances
|
|
COPY package*.json ./
|
|
|
|
# Installer les dépendances
|
|
RUN npm install --legacy-peer-deps
|
|
|
|
# Copier le reste des fichiers du projet
|
|
COPY . .
|
|
|
|
# Builder l'application en mode production
|
|
RUN npm run build
|
|
|
|
# Stage 2: Servir l'application avec Nginx
|
|
FROM nginx:alpine
|
|
|
|
# Copier les fichiers buildés depuis le stage précédent
|
|
COPY --from=build /app/dist/dcb-bo-admin/browser /usr/share/nginx/html
|
|
|
|
# Copier la configuration Nginx personnalisée (optionnel)
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
# Exposer le port 80
|
|
EXPOSE 80
|
|
|
|
# Démarrer Nginx
|
|
CMD ["nginx", "-g", "daemon off;"]
|