Update Dockerfile
This commit is contained in:
11
Dockerfile
11
Dockerfile
@@ -1,21 +1,22 @@
|
|||||||
# Usa Node 20 standard (non slim) per garantire tutte le dipendenze di build
|
# Build stage
|
||||||
FROM node:20 AS build
|
FROM node:20-alpine AS build
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY package.json ./
|
COPY package.json ./
|
||||||
|
|
||||||
# Installazione standard (veloce, parallela)
|
# Install dependencies
|
||||||
RUN npm install
|
RUN npm install
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
# Impostiamo 4GB di RAM per il processo di build (hai ~6GB liberi)
|
# Increase memory limit for the build process to 4GB
|
||||||
# Questo previene il crash durante la compilazione di librerie pesanti come react-markdown
|
|
||||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
||||||
|
|
||||||
|
# Build the application
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
|
# Production stage
|
||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY --from=build /app/dist /usr/share/nginx/html
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
|||||||
Reference in New Issue
Block a user