andreavillari/dockerfile/Dockerfile

26 lines
500 B
Text
Raw Normal View History

2026-10-25 23:46:37 +01:00
# BUILD
FROM node:20-alpine AS builder
WORKDIR /andreavillari
COPY package*.json ./
RUN npm install
2026-10-25 23:54:52 +01:00
# Copia del codice sorgente
2026-10-25 23:46:37 +01:00
COPY . .
2026-10-25 23:54:52 +01:00
# Impostazioni limite meoria Node.js
ENV NODE_OPTIONS:"--max-old-space-size=768"
# Esexuzione della build (verifica che nel package.json ci sia "build")
2026-10-25 23:46:37 +01:00
RUN npm run builder
2026-10-25 23:54:52 +01:00
#PRODUCTION (standalone)
# --- STAGE 2 : Production (Serve file statici con Nginx)---
FROM nginx:alpine
COPY --from-builder /andreavillari
2026-10-25 23:46:37 +01:00
EXPOSE 80
CMD ["nginx","-g","daemon off;"]