Repository navigation
Todo
Description
Is your feature request related to a problem? Please describe.
The Compose stacks from #2368 run the SPA in a second image. ui-new/web/Dockerfile serves web/dist from Nginx, which proxies /uc.v1.*, /config and /healthz to the bridge. The bridge is required anyway, so the separate web image adds:
- a second container and image to build
- an extra hop for every RPC
- an Nginx config to keep in step with the bridge, including a DNS re-resolve workaround so a recreated bridge container is found at its new address
- a startup gate on the bridge's health
Describe the solution you would like
Build the SPA in a stage of the bridge image and serve it from the bridge, as the headwaters Dockerfile does, which @roeap raised in the #2368 review:
- Serve real files from the bundle directory, and fall back to
index.htmlfor client-side routes. A missing file under/assets/stays a 404. - Cache the hashed
/assets/files as immutable, asnginx.confdoes now. - Match the RPC,
/configand/healthzroutes before the fallback. - Turn serving on with a setting that names the bundle directory, so
cargo runwith the Vite dev server is unchanged. - Test the routing, the fallback and the cache headers.
- Then remove the
webservice from both Compose files, along withui-new/web/Dockerfileandui-new/web/nginx.conf. Update the README, theapp()doc comment and thevite.config.tsproxy comment. - With
webgone, define the bridge service and thecargo_configsecret once, for example in a shared file both extend (the remote file requiresUC_SERVER, so the default file can't extend it directly), so the two Compose files stop repeating them. Raised in the #2368 AI review (nit 7).
Additional context
- The bridge served the SPA from
WEB_DIST(aServeDirwith anindex.htmlfallback) until [UI] Consolidate RPC handlers and tighten bridge response validation #2262 removed it, leaving Vite or a separate web server to host it. This brings it back for the image. - Nginx allows 4 MiB request bodies, which is Connect's default limit, so the bridge already enforces the same cap.
- Review comment: [Docker] Add container environments for ui-new #2368 (comment)
- Both this and [UI] ui-new: build the bridge image with cargo-chef on a distroless runtime #2412 reshape
ui-new/server/Dockerfile, so they can land together.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or request
Activity