From 6c74e966db9dc14ac9fade220632960d160043d6 Mon Sep 17 00:00:00 2001 From: Noel Sabia Date: Mon, 19 Oct 2026 19:16:13 +0200 Subject: [PATCH] docs(okf): record the stale-volume pnpm purge abort and its verified fix --- OKF_Nuxt/decisions/dev-container-shape.md | 7 ++++--- OKF_Nuxt/log.md | 3 +++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/OKF_Nuxt/decisions/dev-container-shape.md b/OKF_Nuxt/decisions/dev-container-shape.md index 3969323..e2203c0 100644 --- a/OKF_Nuxt/decisions/dev-container-shape.md +++ b/OKF_Nuxt/decisions/dev-container-shape.md @@ -55,7 +55,8 @@ CMD ["pnpm", "run", "dev", "--", "--host", "0.0.0.0"] | Base image | `node:26-slim`, pinned by digest | The digest makes the build reproducible; the checked digest resolves to Node v26.12.0. | | pnpm | Installed explicitly, pinned to 11.26.0 | Neither `corepack` nor `pnpm` is present in the image. The pin matches the host version, so the same lockfile format is used on both sides. | | User | The image's `node` user, uid 1000 | The host uid is also 1000. Files the dev server writes into the mounted repo stay owned by Noel instead of becoming root-owned. This is not a security measure. | -| `node_modules` | Anonymous volume at `/app/node_modules` | The bind mount replaces all of `/app`, which would otherwise hide the dependencies installed in the image. | +| `node_modules` | Anonymous volume at `/app/node_modules` | The bind mount replaces all of `/app`, which would otherwise hide the dependencies installed in the image. The volume is a snapshot copied from the image when the container is first created; it never refreshes afterwards. | +| Compose env | `CI: "true"` | pnpm 11 verifies dependency state before every `pnpm run` (`runDepsStatusCheck`). When the state is stale it wants to purge `node_modules`, and with no TTY under compose it aborts (`ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY`). CI mode replaces the prompt with a non-interactive reinstall per the mounted lockfile. | | Command | `pnpm run dev -- --host 0.0.0.0` | The dev server would otherwise listen on localhost inside the container and be unreachable from the host. The `--` passes the flag through pnpm to the `dev` script rather than letting pnpm interpret it. | # Evidence @@ -67,6 +68,8 @@ CMD ["pnpm", "run", "dev", "--", "--host", "0.0.0.0"] | `docker run -v :/app -v /app/node_modules -p 13000:3000 cv-site-nuxt:dev` | `HTTP 200` from the host after 4 seconds; server reported "Ready in 2.02s". | | `ls -A /app/node_modules` inside that container | 9 entries (`nuxt`, `vue`, `vue-router`, `.pnpm`, …) — the anonymous volume is populated from the image rather than starting empty. | | Ownership of `.nuxt` on the host after that run | `noel:noel`, so the uid-1000 choice holds. | +| `docker compose up` after the mounted manifests drifted from the volume's snapshot | Exit 1: `ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY` — pnpm's pre-run check found the drift, wanted to purge `node_modules`, and had no TTY to ask. | +| `docker compose up -d --build -V` with `CI: "true"` in the compose file | Builds, renews the stale anonymous volume, server reports "Ready in 2.62s"; no pnpm prompt or abort. | # Side effects on the host @@ -78,8 +81,6 @@ already exists the ownership is left alone — a pre-created directory stays # Not verified -* `docker compose up --build -V` as the remedy for a stale anonymous volume after - a dependency change was not tested. * That a root-owned `node_modules` breaks a host-side `pnpm install` is inferred from the permissions, not measured. diff --git a/OKF_Nuxt/log.md b/OKF_Nuxt/log.md index 44f6521..948476c 100644 --- a/OKF_Nuxt/log.md +++ b/OKF_Nuxt/log.md @@ -1,5 +1,8 @@ # Update Log +## 2026-10-19 (stale anonymous volume aborts pnpm) +* **Update**: [Dev container shape](decisions/dev-container-shape.md) — the anonymous-volume remedy `docker compose up --build -V` moved from "not verified" to evidence (build, volume renewal, server ready in 2.62s). New failure mode recorded: after the mounted manifests drift from the volume's snapshot, pnpm 11's pre-run check wants to purge `node_modules` and aborts without a TTY (`ERR_PNPM_ABORTED_REMOVE_MODULES_DIR_NO_TTY`). Fix: `CI: "true"` in the compose service. + ## 2026-10-18 (evening — release PR unblocked) * **Decision**: Recorded the [production image shape](decisions/production-image.md) - multi-stage, digest-pinned `node:26-slim`, non-root, healthchecked runnable Node server. Built and served locally: HTTP 200, uid 1000, healthcheck healthy. This decides the question that had kept `Dockerfile` empty (and failing the droast job with `DF071`). * **Decision**: Recorded the [vulnerability audit policy](decisions/vulnerability-audit-policy.md) - blocking audit with two reviewed ignores (`node-forge`, `braces`: no patched release exists; both build-time-only paths under nitropack). Learned en route: pnpm 11 ignores the `pnpm` field in `package.json` - settings live in `pnpm-workspace.yaml`.