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
|
||||
FROM node:20 AS build
|
||||
# Build stage
|
||||
FROM node:20-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json ./
|
||||
|
||||
# Installazione standard (veloce, parallela)
|
||||
# Install dependencies
|
||||
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
|
||||
# Increase memory limit for the build process to 4GB
|
||||
ENV NODE_OPTIONS="--max-old-space-size=4096"
|
||||
|
||||
# Build the application
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM nginx:alpine
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
|
||||
Reference in New Issue
Block a user