From acb3628dc86397138a25cd33629dbeabc4039222 Mon Sep 17 00:00:00 2001 From: tiennm99 Date: Sun, 4 Oct 2026 21:42:01 +0700 Subject: [PATCH] feat(goclaw): pass through auto-upgrade and MiniMax env, add healthcheck --- goclaw/.env.example | 9 +++++++++ goclaw/README.md | 21 ++++++++++++++++++--- goclaw/compose.yml | 10 ++++++++++ 3 files changed, 37 insertions(+), 3 deletions(-) diff --git a/goclaw/.env.example b/goclaw/.env.example index d41376c..3d08333 100644 --- a/goclaw/.env.example +++ b/goclaw/.env.example @@ -18,5 +18,14 @@ POSTGRES_USER=goclaw POSTGRES_PASSWORD=goclaw POSTGRES_DB=goclaw +# Apply schema migrations and data hooks on startup. +GOCLAW_AUTO_UPGRADE=true + +# MiniMax keys, for the MiniMax LLM provider and text-to-speech. Leave empty +# when MiniMax is not used. +GOCLAW_MINIMAX_API_KEY= +GOCLAW_TTS_MINIMAX_API_KEY= +GOCLAW_TTS_MINIMAX_GROUP_ID= + # Set to 1 to log full LLM request and response bodies. GOCLAW_TRACE_VERBOSE=0 diff --git a/goclaw/README.md b/goclaw/README.md index 7ec2f3c..8c50bef 100644 --- a/goclaw/README.md +++ b/goclaw/README.md @@ -20,7 +20,9 @@ sessions, encrypted provider keys and the semantic memory. 2. Map the domain to port `18790` and deploy. Migrations run on start. 3. Open the domain and use the setup wizard to add an LLM provider key. -Health check: `GET /health`. +Health check: `GET /health`, which the `goclaw` container also polls as its +compose healthcheck so Coolify can report it healthy. The first check waits 60 +seconds, to leave time for migrations on start. ## Authentication @@ -44,16 +46,29 @@ itself is not used here. | `GOCLAW_GATEWAY_TOKEN` | — | Bearer token for the API and dashboard | | `GOCLAW_ENCRYPTION_KEY` | — | AES-256-GCM key for stored provider keys | | `POSTGRES_USER` / `POSTGRES_PASSWORD` / `POSTGRES_DB` | `goclaw` | Database credentials, read by both containers | +| `GOCLAW_AUTO_UPGRADE` | `true` | Apply schema migrations and data hooks on startup | +| `GOCLAW_MINIMAX_API_KEY` | empty | MiniMax LLM provider key | +| `GOCLAW_TTS_MINIMAX_API_KEY` / `GOCLAW_TTS_MINIMAX_GROUP_ID` | empty | MiniMax text-to-speech credentials | | `GOCLAW_TRACE_VERBOSE` | `0` | Log full LLM request and response bodies | +`GOCLAW_AUTO_UPGRADE` defaults to `true`, the value upstream recommends for +Docker. The image entrypoint already runs `goclaw upgrade` before `serve`, but +it only logs a warning when that fails. With the variable set, `serve` applies +any pending migrations itself rather than stopping on a schema check. + +The MiniMax variables are the one case where a provider key comes from the +environment rather than the dashboard: GoClaw reads them directly for the +MiniMax provider and its text-to-speech. Leave them empty when MiniMax is not +used. + `GOCLAW_HOST`, `GOCLAW_PORT`, `GOCLAW_CONFIG` and `GOCLAW_SKILLS_DIR` are set in `compose.yml` rather than here — they are properties of this layout, not of whoever deploys it. The two paths override image defaults that point outside any volume (`/app/config.json`, `/app/skills`), which would drop the configuration and every installed skill on redeploy. -Provider API keys are not variables: they are entered in the dashboard and -stored encrypted in PostgreSQL. +Other provider API keys are not variables: they are entered in the dashboard +and stored encrypted in PostgreSQL. ## Storage diff --git a/goclaw/compose.yml b/goclaw/compose.yml index 90f80e5..6e12c9e 100644 --- a/goclaw/compose.yml +++ b/goclaw/compose.yml @@ -13,6 +13,10 @@ services: - GOCLAW_PORT=18790 - GOCLAW_CONFIG=/app/data/config.json - GOCLAW_SKILLS_DIR=/app/data/skills + - GOCLAW_AUTO_UPGRADE=${GOCLAW_AUTO_UPGRADE:-true} + - GOCLAW_MINIMAX_API_KEY=${GOCLAW_MINIMAX_API_KEY:-} + - GOCLAW_TTS_MINIMAX_API_KEY=${GOCLAW_TTS_MINIMAX_API_KEY:-} + - GOCLAW_TTS_MINIMAX_GROUP_ID=${GOCLAW_TTS_MINIMAX_GROUP_ID:-} - GOCLAW_TRACE_VERBOSE=${GOCLAW_TRACE_VERBOSE:-0} volumes: - goclaw-data:/app/data @@ -20,6 +24,12 @@ services: depends_on: postgres: condition: service_healthy + healthcheck: + test: ["CMD-SHELL", "wget -qO- http://localhost:18790/health || exit 1"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 60s extra_hosts: - host.docker.internal:host-gateway init: true