Fix: Increase Build-Time Memory Limit (8GB) for Docker

This commit is contained in:
cawcenter
2025-12-14 19:43:18 -05:00
parent 6acc4dccb6
commit f7997cdd88

View File

@@ -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