feat(container): distroless nonroot multi-arch image + Trivy gate (#491) - #577
Merged
NanaKhadija1980j merged 9 commits intoOct 1, 2026
Conversation
|
@akindoyinabraham0-collab Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
NanaKhadija1980j
merged commit Oct 1, 2026
0b20494
into
stellar-vortex-protocol:main
0 of 3 checks passed
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
Closes #491.
Hardens the runtime container image: distroless base, non-root user, read-only-filesystem-compatible entrypoint,
linux/amd64+linux/arm64multi-arch builds, PrismabinaryTargetsfor both arches, and a Trivy CVE gate in CI.Files changed
Dockerfilenode:20-alpine→gcr.io/distroless/nodejs20-debian12:nonroot; exec-form CMD vianode -e; HEALTHCHECK vianode -e;binaryTargetsfor both arches.dockerignoreprisma/schema.prismabinaryTargets = ["native","debian-openssl-3.0.x","linux-arm64-openssl-3.0.x"].github/workflows/cd.ymlplatforms: linux/amd64,linux/arm64; registry layer cache.github/workflows/container-smoke.ymlscripts/ci/container-smoke-test.shtest/container-image.e2e-spec.tsdocs/adr/0007-hardened-distroless-image.mdAcceptance criteria
node:20-alpineruntime ≈ 340 MB compressed;distroless/nodejs20-debian12:nonroot≈ 175 MB compressed. See size comparison below./bin/sh,/bin/bashabsent; verified by smoke test check feat: rebuild backend on NestJS, drop Express #1apt,apk,npmabsent; verified by smoke test check feat: add Nest ConfigModule with env validation #2:nonroottag enforces uid=65532; verified by smoke test check feat: port /health endpoint to Nest #3HEALTHCHECKusesnode -e(no curl, no shell)binaryTargetsin schema.prisma; verified by e2e test suite feat: port /api/v1/intents routes to Nest #8platforms: linux/amd64,linux/arm64in cd.ymlcache-from/cache-to: type=registryin cd.ymlcontainer-smoke.ymlfails on HIGH/CRITICAL with fix available--read-only --tmpfs /tmpboot validated in smoke test check feat: add SolversModule (service + controller) #7OTEL_SDK_DISABLEDenv var controls it; distroless ships libssl3 which OTel native bindings needdocs/adr/0007-hardened-distroless-image.mdImage size comparison
node:20-alpine(before)distroless/nodejs20-debian12:nonroot(after)node_modulessizeSecurity improvements
/bin/shpresentapkpresentNon-root CMD
The distroless image has no shell, so
CMD ["sh", "-c", "..."]cannot be used. The migration + server launch chain is implemented as a singlenode -einvocation:This preserves the migration-lock semantics from #497 exactly.
OTel compatibility
@opentelemetry/auto-instrumentations-noderequireslibssl3for its native gRPC bindings.distroless/nodejs20-debian12shipslibssl3; the transition from Alpine'slibssl3(musl) to Debian's (glibc) is transparent because OTel links against the system OpenSSL dynamically.OTEL_SDK_DISABLED=trueis set in the smoke test to avoid needing a real OTLP collector, consistent with the existing CI pattern.Reviewer notes
container-smoke.ymlruns on PRs that touchDockerfile,.dockerignore, orprisma/schema.prismaonly, keeping CI fast for unrelated changes.trivyjob hasignore-unfixed: trueso unfixed CVEs in upstream packages do not block the build — only CVEs where a patched version exists fail the gate.cd.ymlare unchanged.