Skip to content

[UI] ui-new: serve the SPA from the bridge image #2413

Todo

Description

@newfront

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.html for client-side routes. A missing file under /assets/ stays a 404.
  • Cache the hashed /assets/ files as immutable, as nginx.conf does now.
  • Match the RPC, /config and /healthz routes before the fallback.
  • Turn serving on with a setting that names the bundle directory, so cargo run with the Vite dev server is unchanged.
  • Test the routing, the fallback and the cache headers.
  • Then remove the web service from both Compose files, along with ui-new/web/Dockerfile and ui-new/web/nginx.conf. Update the README, the app() doc comment and the vite.config.ts proxy comment.
  • With web gone, define the bridge service and the cargo_config secret once, for example in a shared file both extend (the remote file requires UC_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

Activity

  1. added this to the 0.9 milestone on Dec 1, 2026
  2. self-assigned this
    on Dec 1, 2026
  3. added
    enhancement
    on Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions