Skip to content

fix: Coolify redeploy (build + gateway) and optional OpenClaw version pin#28

Open
doch2 wants to merge 3 commits into
essamamdani:mainfrom
horang-corp:main
Open

fix: Coolify redeploy (build + gateway) and optional OpenClaw version pin#28
doch2 wants to merge 3 commits into
essamamdani:mainfrom
horang-corp:main

Conversation

@doch2
Copy link
Copy Markdown

@doch2 doch2 commented Feb 21, 2026

Redeploys on Coolify were failing in two ways: the image build died on better-sqlite3 / node-gyp, and the public URL often returned 502 because the gateway was only listening on localhost. This PR addresses both and adds a way to pin the OpenClaw version at build time so you can avoid the Slack Socket Mode crash (#21715) until it’s fixed upstream.

Build (Dockerfile)
Base image is now node:22-bookworm-slim instead of node:lts-*, so we don’t end up on Node 24 with no better-sqlite3 prebuild and no node-gyp. We also run npm install -g node-gyp before the global bun installs so native addons can compile. Added EXPOSE 18789 for the gateway port.

502 / Public URL
Compose already had OPENCLAW_GATEWAY_BIND: lan, but the gateway wasn’t getting it at runtime. Bootstrap now runs openclaw gateway run --bind "$OPENCLAW_GATEWAY_BIND" when that env is set, so the process actually listens on 0.0.0.0 and the Coolify proxy can reach it.

Version pin
New build args: OPENCLAW_VERSION (optional) and existing OPENCLAW_BETA. If OPENCLAW_BETA=true we install openclaw@beta. If OPENCLAW_VERSION is set we install that version (e.g. 2026.2.16). Otherwise we install openclaw@latest. Compose passes these through so you can set them in Coolify (build args or env) and rebuild. Once the Slack listeners bug is fixed upstream you can drop the pin and use latest again.

Files

  • Dockerfile: Node 22, node-gyp, version logic, EXPOSE 18789
  • docker-compose.yaml: OPENCLAW_GATEWAY_BIND, build args for OPENCLAW_BETA and OPENCLAW_VERSION
  • scripts/bootstrap.sh: gateway started with --bind when OPENCLAW_GATEWAY_BIND is set

@discountkeys
Copy link
Copy Markdown

Great work! 🎉

I can confirm this approach works - my fork (discountkeys/openclaw-coolify) has been running on Node 22 since Feb 18 with commit 23c38ba and it's been stable.

This fix resolves the better-sqlite3 build failure issue. The Node 22 pin is the right approach.

Thanks for creating this PR - hope it gets merged soon!

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.

2 participants