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
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.
64 lines
2.6 KiB
Docker
64 lines
2.6 KiB
Docker
# Production image for the Nuxt CV site.
|
|
#
|
|
# Shape: a runnable Node server (SSR). `nuxt build` emits a self-contained
|
|
# Nitro server (.output/server/index.mjs plus its traced dependencies and
|
|
# .output/public), so the runtime stage needs no dependency installation.
|
|
# This answers the open question in OKF_Nuxt/open-questions.md; the gateway
|
|
# proxies to this server instead of embedding static files (see
|
|
# OKF_Nuxt/decisions/production-image.md).
|
|
#
|
|
# Layer order follows OKF_Nuxt/decisions/build-layer-order.md: manifests
|
|
# before source, so dependency changes invalidate everything but source-only
|
|
# edits invalidate almost nothing.
|
|
#
|
|
# Base image is digest-pinned to the same node:26-slim digest as the dev
|
|
# container (OKF_Nuxt/decisions/dev-container-shape.md) - verified for the
|
|
# runner's arm64 and this workstation's x86_64.
|
|
# syntax: no BuildKit-only features used, so the default frontend suffices.
|
|
|
|
FROM node:26-slim@sha256:d62f13676d530f7edf97782729df69713c8ccfe6631e7f62f9ccab65968719a8 AS build
|
|
|
|
# pnpm pinned to the same version as CI (pr-checker.yml pins major 11) and
|
|
# the local toolchain (11.26.0). Installed via npm from the node image - no
|
|
# corepack, which current node images no longer bundle.
|
|
RUN npm install -g pnpm@11.26.0
|
|
|
|
WORKDIR /app
|
|
|
|
# Manifests first: their layer only invalidates when dependencies change.
|
|
# --ignore-scripts skips the `nuxt prepare` postinstall (the source is not
|
|
# copied yet); `nuxt build` prepares what it needs itself. Native binaries
|
|
# (esbuild, unrs-resolver) come from platform-specific optional packages,
|
|
# not install scripts, so skipping scripts is safe here.
|
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./
|
|
RUN pnpm install --frozen-lockfile --ignore-scripts
|
|
|
|
# Source last: the expensive layers above stay cached on source-only edits.
|
|
COPY . .
|
|
RUN pnpm build
|
|
|
|
|
|
FROM node:26-slim@sha256:d62f13676d530f7edf97782729df69713c8ccfe6631e7f62f9ccab65968719a8
|
|
|
|
# pnpm is NOT installed in the runtime image: nothing here runs pnpm.
|
|
ENV NODE_ENV=production \
|
|
HOST=0.0.0.0 \
|
|
PORT=3000
|
|
|
|
WORKDIR /app
|
|
|
|
# Nitro's traced output includes .output/server/node_modules - the only
|
|
# thing the server needs. Runs as the image's non-root `node` user.
|
|
COPY --from=build --chown=node:node /app/.output ./.output
|
|
|
|
USER node
|
|
|
|
EXPOSE 3000
|
|
|
|
# node has no curl/wget in slim; use node's own fetch. The root path is
|
|
# served by the app itself, so a 2xx means the server is genuinely up.
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
|
|
CMD node -e "fetch('http://127.0.0.1:3000/').then(r => process.exit(r.ok ? 0 : 1)).catch(() => process.exit(1))"
|
|
|
|
CMD ["node", ".output/server/index.mjs"]
|