feat: add health check endpoints for Bot and Web
PR Checks / test-and-build (pull_request) Successful in 8m53s

- Web: add /health endpoint with PostgreSQL readiness check (returns 200+JSON or 503)
- Web: add /alive endpoint for liveness probe
- Bot: add BotHealthCheckHostedService serving /health on port 8081 via HttpListener
- Bot: expose port 8081 in Dockerfile and install wget for healthcheck
- compose.yaml: add healthcheck sections for bot and web services
- tests: add TDD tests for both health endpoints

Bump version -> 1.16.0

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-13 10:54:22 +03:00
parent c6aea78ff3
commit 3bea327043
13 changed files with 341 additions and 407 deletions
+12 -2
View File
@@ -49,7 +49,7 @@ services:
crond -f
bot:
image: git.codeanddice.ru/toutsu/gmrelay-bot:1.15.1
image: git.codeanddice.ru/toutsu/gmrelay-bot:1.16.0
restart: always
depends_on:
db:
@@ -60,9 +60,14 @@ services:
- "Telegram__MiniAppUrl=${TELEGRAM_MINI_APP_URL:-}"
networks:
- gmrelay
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8081/health || exit 1"]
interval: 10s
timeout: 5s
retries: 3
web:
image: git.codeanddice.ru/toutsu/gmrelay-web:1.15.1
image: git.codeanddice.ru/toutsu/gmrelay-web:1.16.0
restart: always
depends_on:
db:
@@ -78,6 +83,11 @@ services:
- web_keys:/app/dataprotection-keys
networks:
- gmrelay
healthcheck:
test: ["CMD-SHELL", "wget -qO- http://localhost:8080/health || exit 1"]
interval: 10s
timeout: 5s
retries: 3
volumes:
pgdata: