Repository navigation
ci: Docker image on ghcr.io - #148
Merged
Merged
Conversation
deploy/docker: a multi-stage Dockerfile on node:24-bookworm-slim that installs @cloudhal/cli and create-cloudhal from npm (CLOUDHAL_VERSION) or from packed tarballs (edge) with the blog starter's dependencies next to them, non-root, tini, a /data volume, port 8787, a HEALTHCHECK on /api/health and an entrypoint running `cloudhal studio --init-if-empty`; `site-build` writes the public site to /data/dist; compose.yml with an optional Caddy profile (automatic TLS, Studio proxied, the built site served), .env.example and a Caddyfile. .github/workflows/docker.yml: called by release.yml after the npm publish, by workflow_dispatch (a version, or edge) and nightly (edge from the repository's own tarballs, scripts/pack-packages.ts); linux/amd64 + linux/arm64, SBOM, provenance, a build attestation, the smoke test of scripts/docker-smoke.ts and a Trivy gate; a pull request that touches the image builds and tests it without pushing. Dependabot watches the base image and the compose file. docs/guides/self-host.md, README, CONTRIBUTING "Releasing" step 5. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Madraka <8898640+Madraka@users.noreply.github.com>
This was referenced Nov 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Steps 2–4 of #143: the official self-host image, its compose file, the release workflow and the guide. Opened against
feat/selfhost-runtime(#147) because the image's entrypoint needs that PR's--init-if-empty,CLOUDHAL_HOSTandCLOUDHAL_BASE_URL; GitHub retargets it tomainwhen #147 merges.deploy/docker/Dockerfile: multi-stage onnode:24-bookworm-slim. The build stage (install.mjs) installs@cloudhal/cli+create-cloudhalwith plain npm, from the registry (CLOUDHAL_VERSION) or from packed tarballs (tarballs/index.json, edge), then the blog starter's runtime dependencies next to them socloudhal buildworks on the volume without an install or network. Runtime:tini,ca-certificates, thenodeuser,/datavolume,EXPOSE 8787,CLOUDHAL_HOST=0.0.0.0,CLOUDHAL_INIT=blog, aHEALTHCHECKon the existing public/api/health(nodefetch, no curl),ENTRYPOINT→cloudhal studio --init-if-emptyin/data; OCI labels. No compiler: better-sqlite3 13 ships its prebuilds inside the npm package (prebuilds/linux-x64,linux-arm64, musl too), verified on an amd64 build.bin/site-build: the public site as static HTML into/data/dist, linking the image'snode_modulesinto the project on first use (option (a) of the issue). No publish hook: the clean one (SiteGraphStore.onPublished+ the release purger + a child-process build) is a feature of its own, left as a follow-up issue (text in the session notes;gh issue createwas refused by the permission classifier) and documented asdocker compose exec cloudhal site-build/ a cron line.compose.yml,.env.example,Caddyfile: servicecloudhalon volumecloudhal-data, bound to 127.0.0.1 by default; profilecaddywith automatic TLS forCLOUDHAL_BASE_URL(Studio, proxied withX-Forwarded-*) andCLOUDHAL_SITE_URL(the built site, read-only mount)..github/workflows/docker.yml:workflow_call(fromrelease.yml, next totemplate),workflow_dispatch(a version, or edge), nightlyedgefromscripts/pack-packages.ts, and apull_requesttrigger on the image's files that builds amd64 without pushing. TagsX.Y.Z,X.Y,latest(release only; a dispatch never moves it),edge(nightly only),sha-…;linux/amd64,linux/arm64,cache type=gha,sbom,provenance: mode=max,actions/attest-build-provenance; thenscripts/docker-smoke.ts(empty volume → healthy → first owner through the API → publish →site-build→ the built home page) and Trivy (CRITICAL, fixed only). Every action pinned to a SHA. Dependabot getsdockeranddocker-composefordeploy/docker.docs/guides/self-host.md(requirements, quick start, public origin and proxies, env table, the public site, upgrades with "pinX.Y", backup/restore, health, limits), the README paragraph, CONTRIBUTING "Releasing" step 5,deploy/docker/README.md, the docs site's index.Verified locally (Apple Silicon, Docker Desktop)
Then in the browser: sign-up of the first owner, the scaffolded site listed, Publish from the site page,
docker compose exec cloudhal site-build→/data/dist/index.htmlshows the site name;down -v. The 0.6.2 image installs and runs the CLI but cannot start as a container until a release carries #147 (no--init-if-empty, noCLOUDHAL_HOST), so the first publish to ghcr should be the next release, not a backfill of 0.6.2.Checklist
pnpm lint,pnpm size:check,apps/docsrepo-docs test pass locally (fullpnpm checkin CI); the image's own CI is this workflow'spull_requestrungit commit -s, DCO)🤖 Generated with Claude Code