- 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
Use a separate Docker stage to install prisma CLI + all transitive
deps, then merge into the runner's node_modules with correct ownership.
Verified: prisma --version works inside the container.
Made-with: Cursor
- Add start.sh that runs prisma db push before starting the server,
creating tables automatically on first deploy
- Copy prisma CLI + engines into production image for runtime migrations
- Add configurable storage cleanup: source PDF retention (default 30d)
and image retention (default 180d) with manual trigger in Settings
- Add /api/cleanup endpoint (GET for status, POST to run)
- Add retention settings to AppSettings schema
- Add ListObjectsV2 helper to minio.ts for bulk cleanup
Tested: local Docker build passes
Made-with: Cursor
The postinstall script runs prisma generate, but the prisma schema
files aren't available in the deps stage (only package.json is copied).
The builder stage already runs prisma generate after copying all files.
Made-with: Cursor
Alpine's apk package manager fails in Coolify's build environment due to
network permission issues. Debian slim's apt-get is more reliable in
containerized CI/CD pipelines.
Made-with: Cursor