Add WASM frontend (Archipelagos) to production container #37

Closed
opened 2026-02-26 22:14:46 +00:00 by mik-tf · 0 comments
Owner

Context

PR #34 delivers a working production container with 20/20 services running. However, hero_os_http runs as a server binary without WASM frontend assets — the Dioxus/Archipelagos build is intentionally skipped.

This issue tracks adding the WASM frontend build so hero_os_http serves the full Hero OS UI.

Current State

  • Production container: forge.ourworld.tf/lhumina_code/hero_zero:prod
  • 20 services running (verified locally and via CI)
  • hero_os_http binary runs but serves no frontend (WASM not built)
  • hero_os_openrpc backend works fine

What Needs to Happen

1. Add WASM tooling to Dockerfile.prod builder stage

  • rustup target add wasm32-unknown-unknown
  • cargo install wasm-pack --locked
  • apt-get install -y nodejs npm (if not already present)

2. Build standalone WASM islands

  • Clone hero_archipelagos repo
  • Run scripts/build_standalone.sh --install
  • Install to /root/hero/share/hero_os/islands/
  • 56+ island components (ai, settings, filesystem, room, calendar, etc.)

3. Copy WASM assets to runtime image

COPY --from=builder /root/hero/share/ /root/hero/share/

4. Verify hero_os_http serves assets

  • Check crates/hero_os_http/src/main.rs for static file serving
  • Confirm env vars: HERO_OS_ASSETS, HERO_OS_ISLANDS
  • Test: browser loads Hero OS UI at hero_os_http port

Build Impact

Metric Before After
Build time ~18 min ~25-30 min
Runtime size ~X MB +6-7 MB (WASM)
Services 20 (server only) 20 (with UI)

Approach

  • New PR branching from development (after PR #34 merges)
  • Or branch from development_production_container if #34 not yet merged
  • Separate concern from working backend container

Acceptance Criteria

  • WASM islands built in Dockerfile.prod
  • Assets copied to runtime image
  • hero_os_http serves the Archipelagos UI
  • CI build succeeds with WASM step
  • Browser can load Hero OS frontend from container

References

  • PR #34: Production container with pre-built service binaries
  • hero_archipelagos repo: 56+ Dioxus WASM island components
  • hero_os repo: hero_os_http server + hero_os_openrpc backend
  • docker/build-services.sh line 189: current skip comment
## Context PR #34 delivers a working production container with 20/20 services running. However, `hero_os_http` runs as a server binary **without WASM frontend assets** — the Dioxus/Archipelagos build is intentionally skipped. This issue tracks adding the WASM frontend build so `hero_os_http` serves the full Hero OS UI. ## Current State - Production container: `forge.ourworld.tf/lhumina_code/hero_zero:prod` - 20 services running (verified locally and via CI) - `hero_os_http` binary runs but serves no frontend (WASM not built) - `hero_os_openrpc` backend works fine ## What Needs to Happen ### 1. Add WASM tooling to Dockerfile.prod builder stage - `rustup target add wasm32-unknown-unknown` - `cargo install wasm-pack --locked` - `apt-get install -y nodejs npm` (if not already present) ### 2. Build standalone WASM islands - Clone `hero_archipelagos` repo - Run `scripts/build_standalone.sh --install` - Install to `/root/hero/share/hero_os/islands/` - 56+ island components (ai, settings, filesystem, room, calendar, etc.) ### 3. Copy WASM assets to runtime image ```dockerfile COPY --from=builder /root/hero/share/ /root/hero/share/ ``` ### 4. Verify hero_os_http serves assets - Check `crates/hero_os_http/src/main.rs` for static file serving - Confirm env vars: `HERO_OS_ASSETS`, `HERO_OS_ISLANDS` - Test: browser loads Hero OS UI at hero_os_http port ## Build Impact | Metric | Before | After | |--------|--------|-------| | Build time | ~18 min | ~25-30 min | | Runtime size | ~X MB | +6-7 MB (WASM) | | Services | 20 (server only) | 20 (with UI) | ## Approach - New PR branching from `development` (after PR #34 merges) - Or branch from `development_production_container` if #34 not yet merged - Separate concern from working backend container ## Acceptance Criteria - [ ] WASM islands built in Dockerfile.prod - [ ] Assets copied to runtime image - [ ] hero_os_http serves the Archipelagos UI - [ ] CI build succeeds with WASM step - [ ] Browser can load Hero OS frontend from container ## References - PR #34: Production container with pre-built service binaries - `hero_archipelagos` repo: 56+ Dioxus WASM island components - `hero_os` repo: hero_os_http server + hero_os_openrpc backend - `docker/build-services.sh` line 189: current skip comment
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_services#37
No description provided.