Skip to content

Self-hosting: Docker image on GHCR, configurable base path - #1

Merged
mannes merged 1 commit into
mainfrom
self-host
Sep 24, 2026
Merged

mannes merged 1 commit into
mainfrom
self-host

Conversation

@mannes

@mannes mannes commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Makes the Multimeter web app easy to self-host. Same shape as libreble/brushlog#1.

  • BASE_PATH build env (read via loadEnv, so no Node types needed in apps/web) sets Vite base, manifest start_url/scope and Workbox navigateFallback. Default stays /multimeter/ — Pages build unchanged (verified manifest scope and the font URL).
  • Font — url('/multimeter/fonts/…') → url('/fonts/…'); Vite prefixes the base (built CSS: /multimeter/fonts/… on Pages, /fonts/… at /).
  • Dockerfile — Node 22 + corepack pnpm, pnpm --filter web build → nginx-unprivileged on :8080, app at / (or --build-arg BASE_PATH=/multimeter/).
  • .github/workflows/docker.yml — pushes ghcr.io/libreble/multimeter (amd64+arm64) with GITHUB_TOKEN on main / v* tags. PRs build + run docker/smoke.sh only.
  • README — ## Self-host. (The <noscript> SEO fallback was already here.)

Local: 614 tests, typecheck, prettier green; eslint has the 2 existing warnings only. Both images pass the smoke test, font served 200 in both.

After the first push to main: set the GHCR package to Public.

- BASE_PATH env var sets the Vite base, manifest start_url/scope and the SW
  navigateFallback (defaults to /multimeter/, so the Pages build is unchanged).
  The DSEG7 font URL is base-relative now (Vite prefixes the base).
- Dockerfile: pnpm build of apps/web + unprivileged nginx on :8080, served
  at / by default (--build-arg BASE_PATH=/multimeter/ for a subpath).
- docker.yml: publishes ghcr.io/libreble/multimeter (amd64 + arm64) with
  GITHUB_TOKEN on main and v* tags; PRs build and run docker/smoke.sh.
- README: Self-host section.
@mannes
mannes merged commit b5e39b4 into main Sep 24, 2026
2 checks passed
@mannes
mannes deleted the self-host branch September 24, 2026 06:25
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