# FASE 1: Build (Node.js) FROM node:lts-alpine as build-stage WORKDIR /app COPY package*.json ./ RUN npm install COPY . . # Verifica che il comando nel package.json sia "build" RUN npm run build # FASE 2: Produzione (Nginx) FROM nginx:stable-alpine as production-stage # Copia la configurazione custom di Nginx (vedi file successivo) COPY nginx.conf /etc/nginx/conf.d/default.conf # Copia i file compilati dalla cartella dist (di solito รจ /dist) COPY --from=build-stage /app/dist /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"]