Cut the node_modules prose to one home each; drop a stray tracked file
CI / full-gate (push) Successful in 2m38s

This commit is contained in:
2026-08-05 19:52:09 +02:00
parent 3d3313c0ee
commit ab5c24deb7
7 changed files with 20 additions and 46 deletions
+2 -6
View File
@@ -90,13 +90,9 @@ test("a one-shot bootstrap seeds the stack before web starts", () => {
});
test("deps live above WORKDIR, so no mount creates a root-owned dir in the checkout", () => {
// The daemon creates a missing mount destination as root whatever user the container runs as, so
// a volume at /app/node_modules leaves a root-owned node_modules/ in the developer's own checkout
// (dev bind-mounts `.:/app`). Installing above /app lets Node resolve upward instead — nothing to
// shadow, so nothing to mount over.
// A volume at /app/node_modules would leave a root-owned dir in the checkout (AGENTS.md).
const dockerfile = read("Dockerfile");
// Asserted, not assumed: split() returns the whole file when the marker is missing, which would
// silently widen "before WORKDIR" to "anywhere".
// split() returns the whole file when the marker is missing, widening "before" to "anywhere".
assert.ok(dockerfile.includes("WORKDIR /app"), "the app dir is /app");
const beforeWorkdir = dockerfile.split("WORKDIR /app")[0]!;
assert.match(beforeWorkdir, /npm ci/, "npm ci runs before WORKDIR /app");