.dockerignore: let moments.js into the image; guard test checks the allowlist too

f38f218 failed to build: .dockerignore is an allowlist and kept
moments.js out of the build context. Verified by building the image and
starting the reader from it (health ok).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
MaashkinoozheandClaude Opus 5.5 committed 2026-10-27 13:47:26 +01:00
1 parent f38f218ae0
commit ea8a5b40e7
2 files changed
+7 -1

No files matched your search

+1
View File
@@ -10,6 +10,7 @@
!backup.js !backup.js
!reading-analytics.js !reading-analytics.js
!reading-access.js !reading-access.js
!moments.js
!public/ !public/
!public/** !public/**
!greatest/ !greatest/
+6 -1
View File
@@ -18,5 +18,10 @@ test('every top-level module the reader requires is copied into the image', () =
else pending.push(name + '.js'); else pending.push(name + '.js');
} }
} }
for (const file of seen) assert.ok(copied.has(file), `${file} is required but not copied by the Dockerfile`); // .dockerignore is an allowlist too: a file not let through never reaches COPY.
const allowed = new Set(fs.readFileSync(path.join(root, '.dockerignore'), 'utf8').split(/\r?\n/).filter(line => line.startsWith('!')).map(line => line.slice(1)));
for (const file of seen) {
assert.ok(copied.has(file), `${file} is required but not copied by the Dockerfile`);
assert.ok(allowed.has(file), `${file} is required but not allowed through .dockerignore`);
}
}); });