Repository navigation
perf: slim edge image, scope dockerignore, Node 22 and CI limits - #4
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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.
Phase 1 image/CI optimizations (items 2, 3, 6, 7 of the AxiomNode review).
Changes
src/Dockerfile.edge: merged thedepsandbuildstages, build the SDK once andnpm prune --omit=devit, then runnpm prune --omit=devfor the gateway and install a single real copy of the pruned SDK innode_modules. The separate/workspace/shared-sdk-clientcopy in the runtime stage is gone, andCOPY --chownreplaces the layer-duplicatingchown -R. (npm prunere-creates thefile:SDK link, which does not resolve inside the image, so the copy is restored after the prune.)src/Dockerfile.edge.dockerignore(new): CI builds from the workspace root, sosrc/.dockerignoreis never read. This file is named after the Dockerfile so BuildKit uses it; patterns are relative to the context root and exclude.git,.env*(keeping.env.example),node_modules,dist,coverage,tests,docs. The existingsrc/.dockerignoreis kept for builds whose context issrc/.src/Dockerfile,src/Dockerfile.edgeandci.yml. Noenginesfield exists in this repo.@fastify/corsis already^11here.concurrency(cancel-in-progress only forpull_request) andtimeout-minuteson every job ofci.ymlandsecurity.yml. There is nodocker/build-push-actionin this repo and no trigger that can never build, so those two sub-items do not apply.Verified locally
docker build -f src/Dockerfile.edgefrom a workspace-root context (api-gateway + shared-sdk-client + contracts-and-schemas): image 1.0 GB -> 411 MB; no tsc/vitest/eslint binaries in the runtimenode_modules; container starts ("Gateway started"); build context dropped to a few kB.npm ci,npm run build,npm test(112 passed),npm run linton Node 24 (Node 22 only inside Docker, wheretscbuilds fine).src/Dockerfile(non-edge) builds with Node 22.Not verified
build-pushworkflow itself was not run.npm install->npm ci, left for a separate PR.Overlap
Open PR #3 in this repo may touch workflow/Dockerfile files; I did not check it line by line, so expect possible trivial conflicts in
ci.ymlorsrc/Dockerfile*.