From f7997cdd880f59b74c44bea005e674d15c9cb1a6 Mon Sep 17 00:00:00 2001 From: cawcenter Date: Sun, 14 Dec 2025 19:43:18 -0500 Subject: [PATCH] Fix: Increase Build-Time Memory Limit (8GB) for Docker --- Dockerfile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1b81b6b..55a5428 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,6 +19,12 @@ FROM base AS builder WORKDIR /app COPY --from=deps /app/node_modules ./node_modules COPY . . + +# --- BUILD OPTIMIZATION --- +# Increase memory for the build process (Compiling all Admin UI components takes > 2GB) +# Set to 8GB to be safe on most build runners +ENV NODE_OPTIONS="--max-old-space-size=8192" + # Build the application RUN npm run build @@ -29,8 +35,9 @@ ENV NODE_ENV=production ENV HOST=0.0.0.0 ENV PORT=4321 -# --- GOD MODE OPTIMIZATIONS --- +# --- RUNTIME OPTIMIZATIONS --- # 1. Memory: Allow up to 16GB RAM usage (Prevents GC thrashing on 100k items) +# Ensure the host machine has enough RAM, otherwise this will OOM. ENV NODE_OPTIONS="--max-old-space-size=16384" # 2. Threadpool: Increase libuv pool for heavy database I/O (Default 4 -> 128) ENV UV_THREADPOOL_SIZE=128