chore: optimize docker image to alpine, add job-level ci conditions, and add deployment docs#9
Merged
kenneth-loto merged 2 commits intoJul 1, 2026
Conversation
Merges the completed User module with create, update, and delete endpoints and test coverage, improved Prisma error messages for P2002, P2025, and P2003, enableShutdownHooks for graceful termination, onPoolError logging in PrismaService, the corrected e2e test, readme fixes, and the rootDir tsconfig.build.json fix resolving the start:prod build path bug from develop into main.
…and add deployment docs - switch Dockerfile base from node:22-slim to node:22-alpine reducing image size from 907mb to 406mb - add --omit=peer to npm install preventing @prisma/client from pulling prisma cli and typescript into the production image - prune wasm query compiler files keeping only postgresql and dropping the other four database engines - move 14 step-level if conditions in ci.yml to job-level so skipped jobs do not provision runners at all - create DEPLOYMENT.md with full deploy guide - add deployment section to README.md - create .env.example with all env var names and empty values
|
Base branch auto-updated: This PR has been redirected from |
Dependency ReviewThe following issues were found:
License Issues.github/workflows/ci.yml
OpenSSF Scorecard
Scanned Files
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cuts the Docker image size by 55% with an Alpine base and dependency pruning, reduces CI runner cost by moving change detection conditions to job level, and adds deployment documentation.
What's Changed
node:22-slimtonode:22-alpine, reducing the production image from 907 MB to 406 MB--omit=peerto the install step preventing@prisma/clientfrom pulling the Prisma CLI and TypeScript compiler into the production layerif: needs.changes.outputs.code == 'true'conditions inci.ymlto job level so skipped jobs don't provision runners, saving runner minutes on non-code pushesDEPLOYMENT.mdwith a full deploy guideREADME.md.env.examplelisting all required environment variable names with empty valuesWhy
The 907 MB image was primarily bloated by peer dependencies pulled in transitively by
@prisma/clientand by four WASM query compiler files for database engines the app never uses. Alpine and--omit=peerare low-risk changes for a NestJS app with no native module dependencies. Moving change detection to job level rather than step level means the runner is never provisioned at all for non-code changes, not just skipped partway through, which is a meaningful cost reduction on a busy branch.