main:新增健康检查支持和服务优化

- 在 Worker 中引入轻量级 HTTP 服务器,支持健康检查和就绪检查端点。
- 在 Kubernetes 和 Docker 配置中新增健康检查探针,提升服务稳定性。
- 更新依赖,引入 `aiohttp` 用于健康检查服务。
- 优化部署配置,调整 Redis 主机配置和镜像地址以适配新环境。
This commit is contained in:
2026-02-04 11:58:56 +08:00
parent e0138d5531
commit 55419443cd
6 changed files with 107 additions and 14 deletions

View File

@@ -45,6 +45,9 @@ services:
build:
context: ..
dockerfile: deployment/Dockerfile
platform: linux/amd64
ports:
- "8112:8000"
environment:
- APP_ENV=development
- LOG_LEVEL=INFO
@@ -69,6 +72,12 @@ services:
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/healthz')"]
interval: 30s
timeout: 3s
retries: 3
start_period: 10s
deploy:
replicas: 2