mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-11 03:13:46 +00:00
fix(deploy): add a compose healthcheck for the bot
Coolify ignores its UI health-check settings for Docker Compose apps and reads each service's healthcheck instead, so the bot reported an unknown status. It now checks GET / with the image's busybox wget.
This commit is contained in:
1 parent
277c913f71
commit
11ed121af9
2 files changed
+19
-12
No files matched your search
+12
-6
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in new issue
Block a user