Skip to content

feat(docker): serve the WebGL browser client from the dedicated-server image#123

Merged
marceld23 merged 1 commit into
mainfrom
feat/docker-webgl-play
Jun 29, 2026
Merged

feat(docker): serve the WebGL browser client from the dedicated-server image#123
marceld23 merged 1 commit into
mainfrom
feat/docker-webgl-play

Conversation

@marceld23

Copy link
Copy Markdown
Owner

Summary

Implements #121 — play Blocks Beyond the Stars in a browser, served from the optional Docker server.

  • API /play: same-origin static mount of a Unity WebGL build, with Content-Encoding: br for Unity Brotli files, immutable caching (no-cache for index.html), and a friendly "not installed yet" page. Added ForwardedHeaders so the portal link + wss scheme are correct behind a reverse proxy.
  • Portal: a primary Play in the browser deep-link (/play?server_host=…&server_port=31415&bbs_auto_join=0).
  • Build injection (Unity can'''t build in the image): bind-mount client/Build/WebGL at /app/webgl, or BBS_FETCH_WEBGL=1 pulls a release webgl*.zip via the entrypoint.
  • Public https / wss://: new Caddy TLS profile (docker-compose.tls.yml + docker/Caddyfile) — auto Let'''s Encrypt. localhost/LAN-http need none.
  • Optional PostgreSQL overlay (docker-compose.postgres.yml); SQLite stays the default.
  • release.yml: build-player-webgl + package-webgl jobs ship the webgl*.zip asset.
  • Docs: SELF_HOSTING "Play in the browser" + the TLS matrix + hosting/cost options + Postgres; README mentions browser play.

Verification

  • dotnet build BlocksBeyondTheStars.CI.slnf -warnaserror → 0 warnings.
  • dotnet format --verify-no-changes → clean.
  • PortalPageTests → 5/5 pass (incl. the new deep-link assertion).
  • bash -n docker/entrypoint.sh OK; docker compose config OK for the base, TLS and Postgres overlays.

Caveats

  • The GameCI WebGL build job is untested and may need iteration on the first tagged release. It is an independent job, so a failure there does not block the Windows/Linux/macOS/Docker release assets.
  • End-to-end browser play needs a local Unity WebGL build to mount (none is produced in this PR).

Closes #121

🤖 Generated with Claude Code

…r image

Adds in-browser play to the optional Docker server (issue #121):

- Api: serve a Unity WebGL build at /play (same-origin static mount with
  Content-Encoding for Brotli files, immutable caching, and a friendly
  "not installed yet" page). Honor X-Forwarded-* so it works behind a proxy.
- Portal: a "Play in the browser" deep-link (server_host/port pre-filled).
- Dockerfile/compose: /app/webgl volume + unzip; WS + LAN notes. The build
  is injected out-of-band (bind-mount, or BBS_FETCH_WEBGL=1 pulls a release
  webgl*.zip via the entrypoint) since Unity can't build in the image.
- Public https/wss: new Caddy TLS profile (docker-compose.tls.yml +
  docker/Caddyfile). localhost/LAN need no TLS.
- Optional PostgreSQL overlay (docker-compose.postgres.yml); SQLite default.
- release.yml: build-player-webgl + package-webgl jobs ship the webgl*.zip.
- Docs: SELF_HOSTING "Play in the browser" + TLS matrix + hosting/cost
  options + Postgres; README mentions browser play.

The GameCI WebGL build job is untested and may need iteration on the first
tagged release; a failure there does not block the other release assets.

Closes #121

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@marceld23 marceld23 merged commit 555346b into main Jun 29, 2026
12 checks passed
@marceld23 marceld23 deleted the feat/docker-webgl-play branch June 29, 2026 16:30
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.

WebGL: serve the browser client from the Docker image (play in-browser, self-hosted)

1 participant