fix(docker): run as non-root, prune dev deps, add .dockerignore - #93
robotlearning123 wants to merge 1 commit into
Conversation
Image ran as root, shipped devDependencies, and sent ~340MB of media/git to the build context. Add .dockerignore (drops context to ~14MB), prune dev deps after build via npm ci --omit=dev, and switch to an unprivileged app user before ENTRYPOINT. ARG NPM_CONFIG_IGNORE_SCRIPTS keeps the prune step from failing on the husky prepare script once dev deps are omitted.
|
Independent grok review: BLOCKED (grok-402). Probed the review lane twice — cheap probe and full review call — both returned Verification by execution (deepseek lane) already green on
Resume runbook (single command, after topping up grok balance): |
|
Independent verify-by-execution receipt, 2026-09-28 (chain stage after the build; review stage pending, so this PR stays draft). All commands run at dfda8ff (base e704b49), docker 28.3.3. Issue premise reproduces on main (RED, fresh worktree @ e704b49):
Fix verified (GREEN, this branch):
Build context (BuildKit "transferring context"): 102.24MB -> 13.38MB, measured with the same worktree layout on both sides (in a linked worktree .git is a pointer file, so the main-repo-only .git ~98MB is outside both measurements; the media leak the issue cites is fully covered: du -sk media=70856K, agent-ready-demo.gif=16503533 bytes, node_modules=136452K). Repo test convention on this branch: npm ci && npm run build && npm test -> 57/57 pass, 0 fail. test/e2e is outside the default Note for anyone running the issue's literal oracle: |
|
Reviewer lane recovered — grok review result: VERDICT ERROR. Both bounded grok runs (540s each) timed out mid-review with no verdict emitted; captured output was only opening narration (diff of Dockerfile + .dockerignore vs PR #93 / issue #88 was being read). No blocking finding was confirmed or reproduced. Re-run of the review lane required. |
Fixes #88.
What:
Why: image ran as root (no USER directive) and shipped devDependencies (eslint/typescript/tsx) via bare npm ci; build context included media/ (70MB), agent-ready-demo.gif (16MB), .git and node_modules (~340MB total).
Build-time notes (beyond the literal 3-line prescription, both required for a green build):
Test evidence (all commands run locally):