# ========================== # 1. BUILD ANGULAR SSR # ========================== FROM node:14-alpine AS builder WORKDIR /app # Installer les dépendances Angular COPY angular-client/package*.json ./angular-client/ RUN cd angular-client && npm install # Copier le code source Angular et builder l'app SSR COPY angular-client ./angular-client RUN cd angular-client && npm run build:ssr # ========================== # 2. IMAGE DE PRODUCTION SSR # ========================== FROM node:14-alpine WORKDIR /app # Installer les outils de build nécessaires (si modules natifs) #RUN apk add --no-cache make gcc g++ python3 # Copier package.json pour installer les dépendances du serveur SSR COPY angular-client/package*.json ./ # Copier le build SSR généré COPY --from=builder /app/angular-client/dist/fatboar ./dist/fatboar # Installer les dépendances de production RUN npm install --omit=dev EXPOSE 4000 CMD ["node", "dist/fatboar/server/main.js"]