railyard/stacks/gatus-customers/docker-compose.yml
caelum0x 32d8482958 feat(watch): ship Railyard Watch's box 1 checks agent (stacks/gatus-customers)
apps/console/README.md and lib/watch/types.ts already documented
WATCH_AGENT_TOKEN and RAILYARD_WATCH_LIVE as if stacks/gatus-customers/agent.sh
existed. It did not -- the console side (agentChecks/recordResults, the
/api/v1/watch/agent/* routes) had nothing on the other end to call it, so
Watch could never actually turn on.

Adds the real box 1 stack: a Gatus probe engine (docker-compose.yml,
config.yaml) plus agent.sh, the bridge that pulls the console's check list,
regenerates Gatus's config, reads Gatus's own results, and pushes them back
-- stateless by design since the console already dedupes by last_checked_at.
Plus agent.env.sample, a systemd unit and install.sh (same shape as
tools/reconcile-relay-rago).

Verified against real components: a real ghcr.io/twin/gatus:stable container
and a scratch server wiring the exact shipped lib/watch/http.ts handlers to
a MemoryWatchStore, exercised end to end over two passes against a real
https://example.com check -- which caught and fixed two real bugs (Gatus
refuses to start with zero endpoints; the generated config's timestamp was
forcing a gatus restart on every single pass). Container, volume and image
removed afterward; apps/console's existing 167 tests and 3 bundle tests
pass unchanged (this item touched no console source file).
2026-10-24 01:12:45 +03:00

26 lines
801 B
YAML

services:
gatus:
image: ghcr.io/twin/gatus:stable
container_name: railyard-watch-gatus
restart: unless-stopped
# Internal only: this is the probe engine behind Railyard Watch
# (apps/console/lib/watch), never a surface a customer reaches directly.
# agent.sh is the only thing allowed to call it, over localhost.
ports:
- "127.0.0.1:8083:8080"
environment:
# Directory merge: config.yaml (static) + endpoints.generated.yaml
# (rewritten by agent.sh every pass) are merged into one config.
GATUS_CONFIG_PATH: /config
volumes:
- ./config:/config
- gatus-data:/data
healthcheck:
test: ["CMD", "wget", "-qO-", "http://127.0.0.1:8080/health"]
interval: 10s
timeout: 5s
retries: 5
volumes:
gatus-data: