From 81184040bb6446007a1d454204b03ee618e91ff8 Mon Sep 17 00:00:00 2001 From: Randall Stillwell Date: Thu, 12 Mar 2026 11:07:59 -0500 Subject: [PATCH] Fix Docker build: add explicit gateway dep and reduce memory pressure - Add @ai-sdk/gateway as direct dependency (was only a transitive dep of ai, fragile in Docker builds with --ignore-scripts) - Avoid double prisma generate in Dockerfile by calling next build directly instead of npm run build - Set NODE_OPTIONS max-old-space-size=1536 for the builder stage to prevent OOM on the 3GB Coolify build server Made-with: Cursor --- Dockerfile | 3 ++- package-lock.json | 1 + package.json | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3886cca..cbd8d2a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,7 +16,8 @@ COPY --from=deps /app/node_modules ./node_modules COPY . . ENV NEXT_TELEMETRY_DISABLED=1 -RUN npx prisma generate && npm run build +ENV NODE_OPTIONS="--max-old-space-size=1536" +RUN npx prisma generate && next build # Standalone prisma install for runtime db push FROM base AS prisma-cli diff --git a/package-lock.json b/package-lock.json index 79e58f1..4b6370c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.1.0", "hasInstallScript": true, "dependencies": { + "@ai-sdk/gateway": "^3.0.66", "@ai-sdk/openai-compatible": "^2.0.35", "@aws-sdk/client-s3": "^3.1005.0", "@aws-sdk/s3-request-presigner": "^3.1005.0", diff --git a/package.json b/package.json index 9368509..79e4b52 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "postinstall": "npx prisma generate" }, "dependencies": { + "@ai-sdk/gateway": "^3.0.66", "@ai-sdk/openai-compatible": "^2.0.35", "@aws-sdk/client-s3": "^3.1005.0", "@aws-sdk/s3-request-presigner": "^3.1005.0",