From 7cad437eb429962cb7758708e2cb99d360265e8d Mon Sep 17 00:00:00 2001 From: Marc Mintel Date: Thu, 26 Feb 2026 02:47:49 +0100 Subject: [PATCH] chore: optimize nextjs build memory and rename middleware --- Dockerfile | 4 ++-- next.config.mjs | 3 +++ middleware.ts => proxy.ts | 0 3 files changed, 5 insertions(+), 2 deletions(-) rename middleware.ts => proxy.ts (100%) diff --git a/Dockerfile b/Dockerfile index 9d2f5524..a495233b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,8 +41,8 @@ CMD ["pnpm", "dev:local"] # Build application # Stage 3: Builder (Production) FROM base AS builder -# Limit memory to 2GB to prevent ResourceExhausted on 4GB runner -ENV NODE_OPTIONS="--max-old-space-size=2048" +# Limit memory to 1GB to prevent ResourceExhausted in combination with worker limits +ENV NODE_OPTIONS="--max-old-space-size=1024" RUN pnpm build # Stage 3: Runner diff --git a/next.config.mjs b/next.config.mjs index 2b30c137..f9938ab1 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -13,6 +13,9 @@ const nextConfig = { }, experimental: { optimizePackageImports: ['lucide-react', 'framer-motion', '@/components/ui'], + cpus: 1, + workerThreads: false, + memoryBasedWorkersCount: true, }, reactStrictMode: false, productionBrowserSourceMaps: false, diff --git a/middleware.ts b/proxy.ts similarity index 100% rename from middleware.ts rename to proxy.ts