Install deps above WORKDIR so no root-owned node_modules lands in the checkout #60

Merged
lilleman merged 4 commits from node-modules-ownership into main 2026-08-05 22:09:44 +02:00
Owner

node_modules/ appeared in the checkout as an empty root-owned directory: the daemon created it as the mountpoint for compose.override.yml's - /app/node_modules anonymous volume, which existed only to stop .:/app shadowing the image's deps.

Re-owning it is not possible — the daemon creates a missing mount destination as root whatever user the container runs as (--user 1000:1000 still yields root). So the volume goes: deps now install to /node_modules, one level above WORKDIR /app, and Node resolves bare specifiers upward. Nothing to shadow, nothing to mount, and the stale-on-dep-bump anonymous volume goes with it.

Fallout handled: icons.test.ts resolves lucide-static by specifier instead of <repo>/node_modules; README's npm install now runs --package-lock-only --user \"$(id -u):$(id -g)\" so it cannot recreate the problem; src/compose.test.ts locks the invariant.

Local bash ci.sh is ALL GREEN.

`node_modules/` appeared in the checkout as an empty root-owned directory: the daemon created it as the mountpoint for compose.override.yml's `- /app/node_modules` anonymous volume, which existed only to stop `.:/app` shadowing the image's deps. Re-owning it is not possible — the daemon creates a missing mount destination as root whatever user the container runs as (`--user 1000:1000` still yields root). So the volume goes: deps now install to `/node_modules`, one level above `WORKDIR /app`, and Node resolves bare specifiers upward. Nothing to shadow, nothing to mount, and the stale-on-dep-bump anonymous volume goes with it. Fallout handled: `icons.test.ts` resolves lucide-static by specifier instead of `<repo>/node_modules`; README's `npm install` now runs `--package-lock-only --user \"$(id -u):$(id -g)\"` so it cannot recreate the problem; `src/compose.test.ts` locks the invariant. Local `bash ci.sh` is ALL GREEN.
lilleman added 1 commit 2026-08-05 18:19:01 +02:00
lilleman marked the pull request as work in progress 2026-08-05 18:20:59 +02:00
lilleman added 1 commit 2026-08-05 19:17:14 +02:00
lilleman marked the pull request as ready for review 2026-08-05 19:21:51 +02:00
lilleman added 1 commit 2026-08-05 19:52:17 +02:00
lilleman added 1 commit 2026-08-05 22:04:12 +02:00
Compress AGENTS.md and add a standing rule to trim it on every edit
CI / full-gate (push) Successful in 2m34s
Mirror / github-mirror (push) Successful in 3s
e8b91ecd09
lilleman merged commit e8b91ecd09 into main 2026-08-05 22:09:44 +02:00
lilleman deleted branch node-modules-ownership 2026-08-05 22:09:44 +02:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: larvit/plainpages#60