Files
fiscad-dgi-front/Dockerfile
faviem 321dca04b4
Some checks failed
Angular Docker CI/CD / build-and-deploy (push) Has been cancelled
second commit
2026-04-01 18:24:04 +01:00

41 lines
989 B
Docker
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ==============================
# 1⃣ Build Angular (Node)
# ==============================
FROM node:18-alpine AS build
WORKDIR /app
# Copier uniquement les fichiers nécessaires pour optimiser le cache
COPY package*.json ./
# Installer les dépendances
# RUN npm install
RUN npm ci --legacy-peer-deps
# Copier le reste du projet
COPY . .
# Build Angular (production)
# RUN npm run build -- --configuration production
RUN node --max_old_space_size=4096 ./node_modules/@angular/cli/bin/ng build --configuration production
# ==============================
# 2⃣ Serveur Nginx
# ==============================
FROM nginx:latest
# Supprimer config par défaut
RUN rm -rf /usr/share/nginx/html/*
COPY --from=build /app/dist/infocad-back-office/ /usr/share/nginx/html
COPY --from=build /app/nginx.conf /etc/nginx/conf.d/default.conf
COPY --from=build /app/.htaccess /usr/share/nginx/html
RUN chmod -R 777 /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]