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 Brushlog easy to self-host.

  • BASE_PATH build env sets Vite base + manifest id/start_url/scope. Default stays /brushlog/, so the Pages deploy is unchanged (verified: dist/index.html and manifest still carry /brushlog/).
  • Dockerfile — Node 22 build → nginx-unprivileged on :8080, app at / (or --build-arg BASE_PATH=/brushlog/). SPA fallback, no-cache for index/sw/manifest, immutable /assets/, /healthz, HEALTHCHECK.
  • .github/workflows/docker.yml — pushes ghcr.io/libreble/brushlog (amd64+arm64) with GITHUB_TOKEN on main / v* tags (latest, sha-*, semver). On PRs it only builds and runs docker/smoke.sh (page, every referenced asset, sw.js, manifest content-type, deep-link fallback).
  • README — ## Self-host (docker run, compose, static build, the HTTPS/secure-context caveat).
  • SEO — <noscript> description for non-JS crawlers.

Tested locally: both / and /brushlog/ images pass the smoke test.

After the first push to main: set the GHCR package visibility to Public (package settings) — new packages start private.

- BASE_PATH env var sets the Vite base and the manifest id/start_url/scope
  (defaults to /brushlog/, so the Pages build is unchanged).
- Dockerfile: Node build stage + unprivileged nginx on :8080, served at /
  by default (--build-arg BASE_PATH=/brushlog/ for a subpath). SPA fallback,
  no-cache on index/sw/manifest, immutable hashed assets, /healthz.
- docker.yml: publishes ghcr.io/libreble/brushlog (amd64 + arm64) with
  GITHUB_TOKEN on main and v* tags; PRs build and run docker/smoke.sh.
- README: Self-host section (Docker, compose, static build, HTTPS note).
- index.html: <noscript> description for crawlers without JS.
@mannes
mannes merged commit ce94623 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