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
|
# gold: VNAppMob). If GOLD_VNAPP_API_KEY is unset, the bot auto-fetches
|
||||||
# and caches a key to Mongo.
|
# and caches a key to Mongo.
|
||||||
# Long polling is outbound-only: nothing inbound to route, so no published
|
# Long polling is outbound-only: nothing inbound to route, so no published
|
||||||
# ports and no public domain. `expose` keeps :8080 reachable inside the
|
# ports and no public domain. `expose` only documents the health server's
|
||||||
# Coolify network for the container health monitor against GET / only.
|
# port; it publishes nothing on the host.
|
||||||
expose:
|
expose:
|
||||||
- "8080"
|
- "8080"
|
||||||
# No compose healthcheck: Coolify's own HTTP monitor covers it, so none is
|
# Coolify's UI health check does not apply to Docker Compose apps; it reads
|
||||||
# defined here. Configure that monitor against GET / instead
|
# this block instead. GET / returns text/plain "miti99bot ok". It proves the
|
||||||
# (returns text/plain "miti99bot ok"). Note: a plain / check does not verify
|
# process is serving, not that Mongo is reachable — see
|
||||||
# Mongo connectivity — see docs/deploy-coolify-selfhosted.md.
|
# 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/.
|
# Animation renderer (Node + Remotion + headless Chrome) from renderer/.
|
||||||
# Internal only: the bot reaches it over the compose network, so it has no
|
# 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
|
invalidate Docker cache on every commit. Do not add `SOURCE_COMMIT` to
|
||||||
`compose.yml`; an interpolated empty value can override Coolify's runtime
|
`compose.yml`; an interpolated empty value can override Coolify's runtime
|
||||||
env-file value.
|
env-file value.
|
||||||
6. **Health check:** use Coolify's HTTP monitor against `GET /` (returns
|
6. **Health check:** Coolify's UI health-check settings do not apply to
|
||||||
`text/plain` `miti99bot ok`). The committed `compose.yml` defines no
|
Docker Compose apps; Coolify reads each service's `healthcheck:` in
|
||||||
`healthcheck`, and `cmd/server` has no `-healthcheck` flag. Note: `/`
|
`compose.yml` instead. The `bot` service checks `GET /` (returns
|
||||||
reports healthy even if Mongo is unreachable (the driver auto-reconnects on
|
`text/plain` `miti99bot ok`) with the image's busybox `wget`, and the
|
||||||
the next op); a DB outage will not auto-restart the container — accepted
|
`renderer` service checks `/api/healthz`. Note: `/` reports healthy even if
|
||||||
trade-off.
|
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
|
## 3. Command menu
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user