Skip to content

feat: ssg:coolify publish target (SSG → nginx image → Coolify deploy webhook) - #38

Merged
vianmora merged 1 commit into
mainfrom
feat/coolify-ssg-target
Sep 8, 2026
Merged

vianmora merged 1 commit into
mainfrom
feat/coolify-ssg-target

Conversation

@vianmora

@vianmora vianmora commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Closes webstudio-self-host#24. Follows on from ssr:coolify (#37). One commit.

Refactor

publishBuildCoolifySsr shared parts pulled out:

  • assertCoolifyPublishConfig() — the REGISTRY_URL / webhook / SSRF checks
  • stopLocalServing() — tear down the local container / CF route / Traefik / /var/publish
  • deployImageToCoolify()docker tag :<buildId> + docker login (token via env) + docker push :latest :<buildId> + POST the webhook
  • runInWorkDir() — the per-workdir exec helper

ssg:coolify

publishBuildCoolifySsg: buildSsgOutput() (same prerender as ssg:local), then wrap dist/client in a tiny nginx:alpine image — COOLIFY_SSG_DOCKERFILE + an nginx.conf (.html fallback, immutable cache on /_assets & /assets) + a .dockerignore (*, !dist, !nginx.conf) so the context isn't the whole SSG toolchain. Then the same push + deploy-webhook flow as SSR.

buildDockerImage() now removes a stale .dockerignore first (an ssg:coolify → ssr publish needs the full COPY . /app/).

state.json for coolify sites gains renderMode. RENDER_HOSTS["ssg:coolify"], /capabilities + availableTargets gate ssg:coolify on REGISTRY_URL.

Not here

  • Fork: nothing — renderMode: "ssg" + host: "coolify" un-greys via capabilities.targets; the webhook field already renders for any host: "coolify".
  • self-host: the README "Coolify (remote SSR)" section already covers both (the Docker Image app just uses port 80 instead of 3000 for SSG) — a one-line tweak, folded into a follow-up if wanted.

Test

node --check + smoke tests. E2e (build nginx image → push → webhook) on the Coolify bench alongside the ssr:coolify e2e.

🤖 Generated with Claude Code

https://claude.ai/code/session_017rF3HMB1Z7V3LLsYaUrELs

Refactor: pull the parts publishBuildCoolifySsr shares out —
assertCoolifyPublishConfig(), stopLocalServing(), deployImageToCoolify()
(docker tag/login/push + webhook POST), runInWorkDir().

New: publishBuildCoolifySsg — buildSsgOutput() then wrap dist/client in a
minimal `nginx:alpine` image (COOLIFY_SSG_DOCKERFILE + nginx.conf: .html
fallback, immutable cache on /_assets & /assets) + a .dockerignore so the
build context stays small. Same push + deploy-webhook flow as SSR.
buildDockerImage() now clears a stale .dockerignore left by a previous
ssg:coolify publish.

state.json gains `renderMode` for coolify sites. RENDER_HOSTS wires
ssg:coolify; /capabilities + availableTargets gate it on REGISTRY_URL.

webstudio-self-host#24. Fork needs no change (renderMode "ssg" + host
"coolify" un-greys via capabilities.targets; the webhook field already
shows for any host: "coolify").

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017rF3HMB1Z7V3LLsYaUrELs
@vianmora
vianmora merged commit a9b57b9 into main Sep 8, 2026
1 check passed
@vianmora
vianmora deleted the feat/coolify-ssg-target branch September 8, 2026 20:50
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