优化 MySQL 健康检查配置
Some checks failed
continuous-integration/drone/push Build is failing

- 增加 MySQL 健康检查重试次数和启动等待时间
- 添加 docker compose --wait 参数确保服务就绪
- 增加部署后等待时间
This commit is contained in:
kuzma
2026-01-31 22:25:10 +08:00
parent 365829f495
commit 704670df6d
3 changed files with 10 additions and 10 deletions

View File

@@ -52,8 +52,8 @@ steps:
- docker network create ai_ai-strategy-network 2>/dev/null || true
- docker compose -f docker-compose.test.yml down --remove-orphans || true
- docker compose -f docker-compose.test.yml build --no-cache
- docker compose -f docker-compose.test.yml up -d
- sleep 15
- docker compose -f docker-compose.test.yml up -d --wait --wait-timeout 300 || docker compose -f docker-compose.test.yml up -d
- sleep 30
- docker compose -f docker-compose.test.yml ps
- echo "========== 测试环境部署完成 =========="
- echo "前端地址 - https://pricing.test.zhicheng.ireborn.com.cn"
@@ -113,8 +113,8 @@ steps:
- docker network create ai_ai-strategy-network 2>/dev/null || true
- docker compose -f docker-compose.prod.yml down --remove-orphans || true
- docker compose -f docker-compose.prod.yml build --no-cache
- docker compose -f docker-compose.prod.yml up -d
- sleep 15
- docker compose -f docker-compose.prod.yml up -d --wait --wait-timeout 300 || docker compose -f docker-compose.prod.yml up -d
- sleep 30
- docker compose -f docker-compose.prod.yml ps
- echo "========== 生产环境部署完成 =========="
- echo "前端地址 - https://pricing.zhicheng.ireborn.com.cn"

View File

@@ -115,10 +115,10 @@ services:
- pricing_network_prod
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD}"]
interval: 30s
interval: 10s
timeout: 10s
retries: 3
start_period: 60s
retries: 10
start_period: 120s
logging:
driver: "json-file"
options:

View File

@@ -115,10 +115,10 @@ services:
- pricing_network_test
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost", "-u", "root", "-p${MYSQL_ROOT_PASSWORD:-root_test_123}"]
interval: 30s
interval: 10s
timeout: 10s
retries: 3
start_period: 60s
retries: 10
start_period: 120s
logging:
driver: "json-file"
options: