fix(deck): build the web frontend into the runtime image#275
Conversation
v0.1.0 shipped without the React operator console + setup wizard: the Containerfile COPYs apps/web/dist, but dist is gitignored (so it's never in the build context) and neither the CI workflow nor the Containerfile ran `npm run web:build`. Result: the server booted but /app/ 404'd — no console, no wizard. Validated live on the Deck (building dist in-image + mounting it makes /app/ + /api/config/setup-status serve correctly). Build the frontend in the image itself with the already-installed Node, in one layer with cleanup so node_modules stays out of the final image. The trailing `test -f apps/web/dist/index.html` fails the build loudly if dist didn't render, so a frontend-less image can't ship again. Also fixes local PROTOPEN_BUILD=1. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow. |
|
Caution Review failedPull request was closed or merged during review No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe ChangesReact Frontend Build in Containerfile
Estimated code review effort🎯 2 (Simple) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
QA Audit — PR #275 | fix(deck): build the web frontend into the runtime image
VERDICT: WARN (awaiting CI completion before formal PASS)
CI Status
- Verify workspace config: queued
- Lint: queued
Diff Review
- Single-file change to
deck/Containerfile: adds aRUN npm ci && npm run web:buildlayer that builds the React operator console in-image, then cleans upnode_modulesto keep the final image lean. - Trailing
test -f apps/web/dist/index.htmlacts as a build-time guard — the build fails loudly if the frontend didn't render, preventing a repeat of the v0.1.0 bug where/app/404'd. - Layer ordering is correct:
COPY .precedes theRUN npm ci, so source changes properly invalidate the build cache. Cleanup (rm -rf node_modules, etc.) is thorough.
Observations
- LOW: CI still queued — formal PASS held until checks go terminal green. The change itself is clean: minimal, well-guarded, and validated locally per the PR description.
— Quinn, QA Engineer
|
Submitted COMMENT review on #275. |
Why
v0.1.0 shipped without the React operator console + setup wizard. The Containerfile
COPYsapps/web/dist, butdistis gitignored (never in the build context) and neither the CI workflow nor the Containerfile rannpm run web:build. So the published image's server booted fine but/app/404'd — no console, no wizard. The whole BYO-key flow was unreachable.Found live on the Deck: server up,
[protoPen] React operator console mounted at /appabsent from the boot log,/app/→ 404. Buildingdistin-image and mounting it made/app/→ 200 and/api/config/setup-status→{"setup_complete":false,"presets":["SOUL"]}.What
Build the frontend in the image with the already-installed Node — one
RUNlayer with cleanup sonode_modulesstays out of the final image:RUN npm ci && npm run web:build \ && rm -rf node_modules apps/web/node_modules /root/.npm \ && test -f apps/web/dist/index.htmlThe trailing
test -ffails the build loudly ifdistdidn't render, so a frontend-less image can't ship again. Also fixes the localPROTOPEN_BUILD=1path (previously equally broken). Validated:npm ci && npm run web:buildruns clean in this exact image (2076 modules transformed, built in 4.01s, no tsc errors).Follow-up
Merge → cut
deck-image-v0.1.1→ re-pull on the Deck → the in-image frontend serves and the temporary local-dist mount hotfix drops out.🤖 Generated with Claude Code
Summary by CodeRabbit