From d42d0034a54f1c5d10d618614d95e8057e47f853 Mon Sep 17 00:00:00 2001 From: Yuriy Kirillov Date: Mon, 24 Aug 2026 21:16:11 +0200 Subject: [PATCH] feat: add healthchecks to cloudflared and rybbit's client cloudflared has no shell in the image, so a CMD-SHELL wget/curl check won't work - but it ships its own readiness check specifically for this: `cloudflared tunnel ready` calls the local /ready endpoint and returns a proper exit code, gated behind --metrics actually being enabled (it's off by default). Verified live against the running container before committing: exit 0 once --metrics 0.0.0.0:20241 was added to the run command. rybbit's client (Next.js) has wget available and serves 200 on / - confirmed via docker exec against the live container. Co-Authored-By: Claude Sonnet 5 --- apps/cloudflared/docker-compose.yml | 8 +++++++- apps/rybbit/docker-compose.yml | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/apps/cloudflared/docker-compose.yml b/apps/cloudflared/docker-compose.yml index 554aaa5..6fa050c 100644 --- a/apps/cloudflared/docker-compose.yml +++ b/apps/cloudflared/docker-compose.yml @@ -3,13 +3,19 @@ x-vault-env: &vault-env services: cloudflared: image: cloudflare/cloudflared - command: tunnel --no-autoupdate run + command: tunnel --no-autoupdate --metrics 0.0.0.0:20241 run environment: *vault-env networks: - traefik security_opt: - no-new-privileges:true restart: unless-stopped + healthcheck: + test: ["CMD", "cloudflared", "tunnel", "--metrics", "0.0.0.0:20241", "ready"] + start_period: 30s + interval: 30s + timeout: 5s + retries: 5 networks: traefik: external: true diff --git a/apps/rybbit/docker-compose.yml b/apps/rybbit/docker-compose.yml index b3fcb80..c18c596 100644 --- a/apps/rybbit/docker-compose.yml +++ b/apps/rybbit/docker-compose.yml @@ -38,6 +38,12 @@ services: NEXT_PUBLIC_DISABLE_SIGNUP: ${DISABLE_SIGNUP:-false} depends_on: - backend + healthcheck: + test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1:3002/"] + start_period: 30s + interval: 30s + timeout: 5s + retries: 5 backend: image: ghcr.io/rybbit-io/rybbit-backend extends: