perf(deploy): reduce memory/IO during npm install/build for small VMs (NODE_OPTIONS, npm flags)
This commit is contained in:
@@ -2,9 +2,9 @@ FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
COPY backend/package*.json backend/
|
||||
# Install all dependencies (including dev) in builder so tools like tsc are available for build
|
||||
RUN sh -c 'if [ -f backend/package-lock.json ] || [ -f backend/npm-shrinkwrap.json ]; then npm ci --prefix backend; else npm install --prefix backend; fi'
|
||||
RUN sh -c 'if [ -f backend/package-lock.json ] || [ -f backend/npm-shrinkwrap.json ]; then npm ci --prefix backend --no-audit --no-fund --prefer-offline --no-progress; else npm install --prefix backend --no-audit --no-fund --prefer-offline --no-progress; fi'
|
||||
COPY backend/ backend/
|
||||
RUN npm run build --prefix backend
|
||||
RUN sh -c 'NODE_OPTIONS="--max_old_space_size=512" npm run build --prefix backend'
|
||||
|
||||
FROM node:20-alpine
|
||||
WORKDIR /app
|
||||
|
Reference in New Issue
Block a user