Lower build memory ceiling to 1024MB and clean npm cache in deps layer

The 3GB Coolify server OOMs during Next.js build when node uses 1.5GB
because Docker overhead + OS leaves less than 2GB available. Also
clean npm cache after install to free ~100MB in the deps layer.

Made-with: Cursor
This commit is contained in:
Randall Stillwell 2026-04-07 23:14:09 -05:00
parent 27bdf9d415
commit 3cbba0cf4e

View file

@ -8,7 +8,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
FROM base AS deps
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts
RUN npm ci --ignore-scripts && npm cache clean --force
FROM base AS builder
WORKDIR /app
@ -16,7 +16,7 @@ COPY --from=deps /app/node_modules ./node_modules
COPY . .
ENV NEXT_TELEMETRY_DISABLED=1
ENV NODE_OPTIONS="--max-old-space-size=1536"
ENV NODE_OPTIONS="--max-old-space-size=1024"
RUN npx prisma generate && npx next build
# Standalone prisma install for runtime db push