feat: 增加结构化日志和服务就绪检查
This commit is contained in:
@@ -40,6 +40,8 @@ services:
|
||||
DEBUG: "false"
|
||||
DATABASE_URL: ${DATABASE_URL:?必须配置经过 URL 编码的 DATABASE_URL}
|
||||
REDIS_URL: ${REDIS_URL:?必须配置经过 URL 编码的 REDIS_URL}
|
||||
READINESS_REQUIRES_REDIS: "true"
|
||||
LOG_LEVEL: INFO
|
||||
BACKEND_WORKERS: ${BACKEND_WORKERS:-4}
|
||||
DB_POOL_SIZE: ${DB_POOL_SIZE:-20}
|
||||
DB_MAX_OVERFLOW: ${DB_MAX_OVERFLOW:-20}
|
||||
@@ -58,6 +60,12 @@ services:
|
||||
condition: service_healthy
|
||||
redis:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8100/api/ready', timeout=3)"]
|
||||
interval: 15s
|
||||
timeout: 5s
|
||||
retries: 10
|
||||
start_period: 30s
|
||||
|
||||
user-client:
|
||||
build:
|
||||
@@ -79,9 +87,12 @@ services:
|
||||
volumes:
|
||||
- ./deploy/gateway.prod.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
depends_on:
|
||||
- backend
|
||||
- user-client
|
||||
- admin-web
|
||||
backend:
|
||||
condition: service_healthy
|
||||
user-client:
|
||||
condition: service_started
|
||||
admin-web:
|
||||
condition: service_started
|
||||
|
||||
volumes:
|
||||
ai_kb_v2_mysql_data:
|
||||
|
||||
Reference in New Issue
Block a user