fix(build): disable webpack build workers to reduce memory
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 <noreply@anthropic.com>
This commit is contained in:
+1
-1
@@ -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 ──────────────────────────────────────────────────────────────────
|
||||
|
||||
@@ -26,6 +26,9 @@ const withPWA = withPWAInit({
|
||||
const nextConfig: NextConfig = {
|
||||
output: "standalone",
|
||||
turbopack: {},
|
||||
experimental: {
|
||||
webpackBuildWorker: false,
|
||||
},
|
||||
};
|
||||
|
||||
export default withPWA(nextConfig);
|
||||
|
||||
Reference in New Issue
Block a user