feat(ops): add /healthz endpoint and container healthcheck

Expose a lightweight /healthz route on the main aiohttp server and
wire docker-compose healthcheck so orchestrators can detect failures.
This commit is contained in:
3252a8
2026-04-27 08:43:58 +03:00
parent 4740666d63
commit dae1a6889b
2 changed files with 11 additions and 0 deletions
+5
View File
@@ -58,6 +58,11 @@ async def build_and_start_web_app(
app = web.Application()
_inject_shared_instances(app, dp, bot, settings, async_session_factory)
async def _healthcheck(request: web.Request) -> web.Response:
return web.json_response({"status": "ok"})
app.router.add_get("/healthz", _healthcheck)
setup_application(app, dp, bot=bot)
telegram_uses_webhook_mode = bool(settings.WEBHOOK_BASE_URL)