From b417eb648c1012696ce4765773ff3e28fdbe1889 Mon Sep 17 00:00:00 2001 From: Arnaud Nelissen Date: Mon, 15 Jun 2026 16:21:01 +0200 Subject: [PATCH] fix(build): disable webpack build workers to reduce memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Next.js spawns per-worker webpack processes — each has its own heap. On low-RAM servers total usage exceeds available memory → SIGKILL (silent). webpackBuildWorker: false runs compilation in main process only. Also lower JS heap cap to 512MB to leave room for OS + pnpm. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 2 +- next.config.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 0ba3681..fcd0375 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,7 @@ COPY . . RUN pnpm prisma generate ENV NEXT_TELEMETRY_DISABLED=1 -ENV NODE_OPTIONS="--max-old-space-size=2048" +ENV NODE_OPTIONS="--max-old-space-size=512" RUN pnpm build # ── runner ────────────────────────────────────────────────────────────────── diff --git a/next.config.ts b/next.config.ts index 5100a23..428fd9f 100644 --- a/next.config.ts +++ b/next.config.ts @@ -26,6 +26,9 @@ const withPWA = withPWAInit({ const nextConfig: NextConfig = { output: "standalone", turbopack: {}, + experimental: { + webpackBuildWorker: false, + }, }; export default withPWA(nextConfig);