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
This commit is contained in:
Randall Stillwell 2026-03-12 11:07:59 -05:00
parent a6270a605a
commit 81184040bb
3 changed files with 4 additions and 1 deletions

View file

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

1
package-lock.json generated
View file

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

View file

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