Skip to content

fix(deck): build the web frontend into the runtime image#275

Merged
mabry1985 merged 1 commit into
mainfrom
fix/deck-image-web-build
Jun 21, 2026
Merged

fix(deck): build the web frontend into the runtime image#275
mabry1985 merged 1 commit into
mainfrom
fix/deck-image-web-build

Conversation

@mabry1985

@mabry1985 mabry1985 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Why

v0.1.0 shipped without the React operator console + setup wizard. The Containerfile COPYs apps/web/dist, but dist is gitignored (never in the build context) and neither the CI workflow nor the Containerfile ran npm 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 /app absent from the boot log, /app/ → 404. Building dist in-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 RUN layer with cleanup so node_modules stays 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.html

The trailing test -f fails the build loudly if dist didn't render, so a frontend-less image can't ship again. Also fixes the local PROTOPEN_BUILD=1 path (previously equally broken). Validated: npm ci && npm run web:build runs 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

  • Chores
    • Optimized container build process to include explicit React operator console build and validation
    • Added verification to ensure frontend assets are properly generated during image creation
    • Improved image efficiency by removing unnecessary build artifacts

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>
@protoquinn

protoquinn Bot commented Jun 21, 2026

Copy link
Copy Markdown

👀 Quinn is reviewing — verdict (PASS / WARN / FAIL) + findings to follow.

@coderabbitai

coderabbitai Bot commented Jun 21, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: ccc71d25-dc21-49ce-806b-74ba2073c406

📥 Commits

Reviewing files that changed from the base of the PR and between 7f1f8cf and fd90467.

📒 Files selected for processing (1)
  • deck/Containerfile

Walkthrough

The deck/Containerfile is updated to build the React operator console inside the container image. After copying source and setting the working directory, it runs npm ci and npm run web:build, removes node_modules and npm caches, and asserts that apps/web/dist/index.html exists, failing the build if the frontend output is absent.

Changes

React Frontend Build in Containerfile

Layer / File(s) Summary
App source copy and React build step
deck/Containerfile
Updates the app-source comment to note only top-level modules are copied, then adds npm ci, npm run web:build, cleanup of node_modules and npm cache directories, and a test -f apps/web/dist/index.html guard that fails the image build if the frontend was not produced.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: building the React web frontend into the Docker runtime image, which directly addresses the critical issue described in the PR objectives.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/deck-image-web-build

Comment @coderabbitai help to get the list of available commands and usage tips.

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a RUN npm ci && npm run web:build layer that builds the React operator console in-image, then cleans up node_modules to keep the final image lean.
  • Trailing test -f apps/web/dist/index.html acts 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 the RUN 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

@protoquinn

protoquinn Bot commented Jun 21, 2026

Copy link
Copy Markdown

Submitted COMMENT review on #275.

@protoquinn protoquinn Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI terminal-green, no blockers on prior review — auto-approving on green (#748).

@mabry1985 mabry1985 merged commit f646760 into main Jun 21, 2026
5 of 6 checks passed
@mabry1985 mabry1985 deleted the fix/deck-image-web-build branch June 21, 2026 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant