diff --git a/compose.yml b/compose.yml index 5b7c1f6..0fdeb4e 100644 --- a/compose.yml +++ b/compose.yml @@ -32,14 +32,20 @@ services: # gold: VNAppMob). If GOLD_VNAPP_API_KEY is unset, the bot auto-fetches # and caches a key to Mongo. # Long polling is outbound-only: nothing inbound to route, so no published - # ports and no public domain. `expose` keeps :8080 reachable inside the - # Coolify network for the container health monitor against GET / only. + # ports and no public domain. `expose` only documents the health server's + # port; it publishes nothing on the host. expose: - "8080" - # No compose healthcheck: Coolify's own HTTP monitor covers it, so none is - # defined here. Configure that monitor against GET / instead - # (returns text/plain "miti99bot ok"). Note: a plain / check does not verify - # Mongo connectivity — see docs/deploy-coolify-selfhosted.md. + # Coolify's UI health check does not apply to Docker Compose apps; it reads + # this block instead. GET / returns text/plain "miti99bot ok". It proves the + # process is serving, not that Mongo is reachable — see + # docs/deploy-coolify-selfhosted.md. busybox wget ships in the Alpine image. + healthcheck: + test: ["CMD-SHELL", "wget -q -O /dev/null http://127.0.0.1:8080/ || exit 1"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 20s # Animation renderer (Node + Remotion + headless Chrome) from renderer/. # Internal only: the bot reaches it over the compose network, so it has no diff --git a/docs/deploy-coolify-selfhosted.md b/docs/deploy-coolify-selfhosted.md index 5299a00..c82d984 100644 --- a/docs/deploy-coolify-selfhosted.md +++ b/docs/deploy-coolify-selfhosted.md @@ -159,12 +159,13 @@ MP4, with the same text fallback. invalidate Docker cache on every commit. Do not add `SOURCE_COMMIT` to `compose.yml`; an interpolated empty value can override Coolify's runtime env-file value. -6. **Health check:** use Coolify's HTTP monitor against `GET /` (returns - `text/plain` `miti99bot ok`). The committed `compose.yml` defines no - `healthcheck`, and `cmd/server` has no `-healthcheck` flag. Note: `/` - reports healthy even if Mongo is unreachable (the driver auto-reconnects on - the next op); a DB outage will not auto-restart the container — accepted - trade-off. +6. **Health check:** Coolify's UI health-check settings do not apply to + Docker Compose apps; Coolify reads each service's `healthcheck:` in + `compose.yml` instead. The `bot` service checks `GET /` (returns + `text/plain` `miti99bot ok`) with the image's busybox `wget`, and the + `renderer` service checks `/api/healthz`. Note: `/` reports healthy even if + Mongo is unreachable (the driver auto-reconnects on the next op); a DB + outage will not mark the container unhealthy — accepted trade-off. ## 3. Command menu