Fix: Increase Build-Time Memory Limit (8GB) for Docker
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user