From 3cbba0cf4e910d90d8e4915b964b6add3ecb7af7 Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Tue, 7 Apr 2026 23:14:09 -0500 Subject: [PATCH] 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 --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9eb18d2..814f051 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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