Files
CV_Site_Nuxt/OKF_Nuxt/decisions/production-image.md
T
Noel Sabia f32ad07648
PR Check / Security scan (Snyk) (pull_request) Skipped
PR Check / ESLint (pull_request) Canceled after 28s
PR Check / Typecheck (pull_request) Canceled after 0s
PR Check / Secret scan (gitleaks) (pull_request) Canceled after 0s
PR Check / Dependency audit (pull_request) Canceled after 0s
PR Check / Dockerfile lint (droast) (pull_request) Canceled after 0s
PR Check / AI code review (opencode) (pull_request) Canceled after 0s
fix: unblock the release PR - real production image, reviewed audit ignores
The release PR (chore: release main) failed two checks, both verified
locally before pushing:

- droast: the empty production Dockerfile failed DF071 (no
  instructions). The new Dockerfile is a runnable Node server (SSR):
  multi-stage, manifests-first layers, digest-pinned node:26-slim (same
  digest as the dev container), non-root uid 1000, node-fetch
  HEALTHCHECK. Measured: docker build succeeds in-image, container
  serves HTTP 200 and reports healthy; droast reports 0 errors.
- audit: two high advisories with NO patched release anywhere
  (node-forge <=1.4.0 and braces <=3.0.3 are the newest npm versions;
  both build-time-only paths under nitropack). Recorded as
  auditConfig.ignoreGhsas in pnpm-workspace.yaml with the reason and
  removal condition - the audit output still names what it skipped.
  pnpm 11 ignores the pnpm field in package.json (caught locally via
  the WARN before pushing); settings live in pnpm-workspace.yaml.

OKF_Nuxt: recorded the production-image and audit-policy decisions,
updated log, indexes and open questions.
2026-10-18 21:14:12 +02:00

2.4 KiB

type, title, description, tags, status, generated, verified, sources
type title description tags status generated verified sources
Decision Production image shape The production Dockerfile is a runnable Node server for the SSR app - multi-stage, digest-pinned base, non-root, healthchecked.
decision
docker
nuxt
production
stable
by at
opencode-go/glm-5.3-flash 2026-10-18T19:10:00Z
by at
human:noel not yet
id resource title
dockerfile Dockerfile Production Dockerfile
id resource title
droast .gitea/workflows/pr-checker.yml Dockerfile lint job (droast)

Decision

Dockerfile builds the production image as a runnable Node server:

  • Stage build: manifests first, pnpm install --frozen-lockfile --ignore-scripts, then the full source, then pnpm build - Nitro emits a self-contained .output/server/index.mjs with its traced dependencies.
  • Stage runtime: only .output is copied (chowned to node), the process runs as the image's non-root node user, the base image is the same digest-pinned node:26-slim as the dev container, and a HEALTHCHECK (node's own fetch, no curl in slim) polls the root path.

This answers the previously open question "runnable Node server, or static files embedded in the gateway". The static-in-gateway plan recorded in the sibling OKF_CV_Website bundle predates the SSR reality of this repository: the gateway must now proxy to this server instead of embedding .output/public/. That sibling decision needs updating; the compose wiring is still open.

Why --ignore-scripts

The postinstall script (nuxt prepare) runs before the source is copied and would fail. nuxt build prepares everything it needs itself. Native binaries (esbuild, unrs-resolver) come from platform-specific optional packages, not install scripts, so skipping scripts loses nothing.

Verified (measured, 2026-10-18)

  • docker build on x86_64: full build succeeds in-image ("Build complete").
  • docker run: HTTP 200 on / (28 KB page), process runs as uid=1000(node), healthcheck reports healthy.
  • droast 1.7.0 (sha-verified): 0 errors; one accepted DF007 warning on COPY . . - that line is the source-last layer design.
  • arm64 correctness rests on the multi-arch digest pin (proven in CI for the dev container); the image build itself has only run on x86_64.

Revisit when

  • The gateway/compose stack is assembled (proxy target, port, network).
  • A go preset or full-static nuxt generate becomes preferable.