hailin
|
c5787020d2
|
feat(health): 为全部12个微服务添加Docker健康检查
## 变更概要
所有后端微服务均增加 Docker HEALTHCHECK 指令,统一通过 GET /health
端点检测服务存活状态。解决 `docker ps` 中13个容器无 (healthy) 状态的问题。
## NestJS 服务 (9个)
- auth-service (:3010), user-service (:3001), issuer-service (:3002),
clearing-service (:3004), compliance-service (:3005), ai-service (:3006),
notification-service (:3008), telemetry-service (:3011), admin-service (:3012)
- 7个服务的 app.module.ts 新增 `import { HealthModule } from '@genex/common'`
注册标准健康检查控制器 (GET /health, /health/ready, /health/live)
- telemetry-service 和 admin-service 已有自建 HealthController,无需导入
- Dockerfile: HEALTHCHECK --interval=30s --start-period=15s --retries=3
## Go 服务 (3个)
- trading-service (:3003), translate-service (:3007), chain-indexer (:3009)
- 已有 /health 端点 (Gin 路由),仅 Dockerfile 添加 HEALTHCHECK
- Dockerfile: HEALTHCHECK --interval=30s --start-period=10s --retries=3
## Kafka Connect
- docker-compose.yml 添加 healthcheck (curl http://localhost:8083/)
## 健康检查方式
- 所有服务统一使用 `wget --spider http://localhost:PORT/health`
(node:20-alpine 和 alpine:3.19 均自带 BusyBox wget)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
2026-02-20 05:39:25 -08:00 |