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 COLLET easy to self-host. Same shape as libreble/brushlog#1.

  • BASE_PATH build env sets Vite base, manifest id/start_url/scope and Workbox navigateFallback. Default stays /collet/ — Pages build unchanged (verified manifest scope + createHandlerBoundToURL("/collet/index.html")).
  • Dockerfile — Node 22 build → nginx-unprivileged on :8080, app at / (or --build-arg BASE_PATH=/collet/). SPA fallback (so /guide/... deep links work), no-cache for index/sw/manifest, immutable /assets/, /healthz.
  • .github/workflows/docker.yml — pushes ghcr.io/libreble/collet (amd64+arm64) with GITHUB_TOKEN on main / v* tags. PRs build + run docker/smoke.sh only.
  • SEO — meta.ts canonical now always points at https://libreble.github.io/collet/<route> (was window.location.origin, which made self-hosted copies claim to be canonical). Verified headless: self-hosted /guide → https://libreble.github.io/collet/guide. Plus a <noscript> description.
  • README — ## Self-host.

Local: typecheck, oxlint, prettier, selftest green; both images pass the smoke test.

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

- BASE_PATH env var sets the Vite base, manifest id/start_url/scope and the
  SW navigateFallback (defaults to /collet/, so the Pages build is unchanged).
- Dockerfile: Node build stage + unprivileged nginx on :8080, served at /
  by default (--build-arg BASE_PATH=/collet/ for a subpath). SPA fallback for
  the /guide routes, no-cache on index/sw/manifest, immutable assets, /healthz.
- docker.yml: publishes ghcr.io/libreble/collet (amd64 + arm64) with
  GITHUB_TOKEN on main and v* tags; PRs build and run docker/smoke.sh.
- meta.ts: per-route canonical always points at libreble.github.io/collet/,
  also on self-hosted copies (it used window.location.origin).
- README: Self-host section. index.html: <noscript> description.
@mannes
mannes merged commit 8cbed19 into main Sep 24, 2026
1 check passed
@mannes
mannes deleted the self-host branch September 24, 2026 06:24
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