24 lines
614 B
Docker
24 lines
614 B
Docker
# Usa Node 20 standard (non slim) per garantire tutte le dipendenze di build
|
|
FROM node:20 AS build
|
|
|
|
WORKDIR /app
|
|
|
|
COPY package.json ./
|
|
|
|
# Installazione standard (veloce, parallela)
|
|
RUN npm install
|
|
|
|
COPY . .
|
|
|
|
# Impostiamo 4GB di RAM per il processo di build (hai ~6GB liberi)
|
|
# Questo previene il crash durante la compilazione di librerie pesanti come react-markdown
|
|
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
|
|
|
RUN npm run build
|
|
|
|
FROM nginx:alpine
|
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
|
COPY --from=build /app/dist /usr/share/nginx/html
|
|
EXPOSE 80
|
|
CMD ["nginx", "-g", "daemon off;"]
|