Commit c3d158f
fix(dockerfile): rehab pc2-node/Dockerfile for bugs 2-5 caught by docker-smoke
Three surgical fixes to pc2-node/Dockerfile, all targeting bugs that
docker-smoke (added 2026-05-18 in CI-HARDENING-A4-D1) caught on its
first 2 runs:
BUG 2 (BOOT-BLOCKING): Config copy path wrong
Was: COPY --from=builder /app/config ./config
Now: COPY --from=builder /app/pc2-node/config ./config
loader.ts:139 computes DEFAULT_CONFIG_PATH = __dirname/../../config/default.json
which resolves to /app/config/default.json at runtime. The previous
path was copying from the host repo-root /config/ which only contains
pc2.json.example + pc2.production.json — NO default.json. The actual
file lives at pc2-node/config/default.json. Container exited with
"Default config not found" on every previous run.
BUG 3: WASM apps never copied to production image
Added: COPY --from=builder /app/pc2-node/wasm-apps ./wasm-apps
7 .wasm binaries (cenc-decrypt, cenc-encrypt, ddrm-renderer,
mp4-split, ipfs-assemble, evm-multicall, amm-engine) are committed
to the repo as pre-built artifacts but never made it into the
production image. Result: dDRM + media segmentation + AMM all
silently fall back to inferior paths.
We do NOT run build-wasm.sh in Dockerfile — requires Rust+cargo+
wasm-opt (~200MB build-stage bloat) for binaries already committed.
BUGS 4+5: sharp + @napi-rs/canvas native bindings missing
Added after npm ci:
RUN cd pc2-node && npm install --no-save --include=optional \
sharp @napi-rs/canvas
Classic npm/cli#4828: pc2-node/package-lock.json was generated on
macOS-arm64 (lead dev environment), so it only records
@img/sharp-darwin-arm64 and @napi-rs/canvas-darwin-arm64. When
npm ci runs on alpine/linux/musl/x64 in the Dockerfile builder, it
strictly follows the lockfile and silently skips the linux variants
that aren't recorded there.
Fix: after npm ci, force a non-lockfile install with --include=optional
--no-save which triggers each package's install/check.js hook to
detect alpine/linux/musl/x64 and download the correct prebuilts
(@img/sharp-linuxmusl-x64 + libvips sibling,
@napi-rs/canvas-linux-x64-musl). --no-save means we don't modify
package.json or the lockfile.
Note: legacy canvas@2.x left as graceful-degradation fallback (already
in optionalDependencies, codebase has fallback logic). Migrating to
@napi-rs/canvas everywhere is Phase 2 source-code work, separate ticket.
VALIDATION:
- All 7 .wasm files confirmed tracked in git (git ls-files)
- default.json + config.json + models-catalog.json confirmed at
pc2-node/config/ (correct location for COPY)
- .dockerignore only excludes Dockerfile/.dockerignore/node_modules/puter —
wasm-apps + config will be in build context
See .cursor/tasks/RELEASE-ENGINEERING-V1280/DOCKERFILE-REHAB-V1280.md for
full diagnoses and acceptance criteria.
Aims to take docker-smoke from experimental-red to first green run.
Need 3 consecutive green runs to promote to required gate.
Co-authored-by: Cursor <cursoragent@cursor.com>1 parent dc0537e commit c3d158f
2 files changed
Lines changed: 181 additions & 2 deletions
Lines changed: 135 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
83 | 106 | | |
84 | 107 | | |
85 | 108 | | |
| |||
122 | 145 | | |
123 | 146 | | |
124 | 147 | | |
125 | | - | |
126 | | - | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
127 | 171 | | |
128 | 172 | | |
129 | 173 | | |
| |||
0 commit comments