Skip to content

build(docker): production runtime on distroless Node - #8

Merged
devchaudhary24k merged 3 commits into
mainfrom
dev
Sep 27, 2026
Merged

devchaudhary24k merged 3 commits into
mainfrom
dev

Conversation

@devchaudhary24k

@devchaudhary24k devchaudhary24k commented Sep 27, 2026 •

Copy link
Copy Markdown
Member

The Docker image workflow on `main` failed its Trivy gate, so nothing was pushed to GHCR. The failure was CVE-2026-59873 (critical) in the `tar` package inside npm, which comes with `node:24.17.0-slim`.

The runtime stage is now `gcr.io/distroless/nodejs24-debian13:nonroot`:

  • No npm, yarn, corepack or shell, so none of their dependencies ship or get scanned
  • Runs as non-root (65532) by default
  • The Sentry server dependencies are installed in the build stage (without optional deps or install scripts, so no `sentry-cli` binary) and copied over
  • Unused `VITE_*` build args and duplicate OCI labels removed. `docker/metadata-action` sets the labels.
  • Image goes from 518 MB to 377 MB

DEPLOY.md's example health check now points at `/nodejs/bin/node`.

Checked locally:

  • `scripts/smoke.sh` passes and the container reports `healthy`
  • Trivy finds no CRITICAL or HIGH issues with a fix

🤖 Generated with Claude Code

devchaudhary24k and others added 3 commits September 27, 2026 23:43
The Docker image workflow failed its Trivy gate on CVE-2026-59873 in the
tar package bundled inside the base image's npm, so no image was pushed
to GHCR. The server never runs a package manager, so remove them after
installing Sentry.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Build the Sentry runtime dependencies in the build stage and copy them
into gcr.io/distroless/nodejs24-debian13:nonroot. The image has no npm,
yarn, corepack or shell, so there is nothing to strip afterwards, it runs
as a non-root user by default and drops about 140 MB.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@devchaudhary24k devchaudhary24k changed the title fix(docker): drop npm, corepack and yarn from the runtime image build(docker): production runtime on distroless Node Sep 27, 2026
@devchaudhary24k
devchaudhary24k merged commit b3998bd into main Sep 27, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant