修复开发容器启动并加固部署配置

This commit is contained in:
Cheng Zhou
2026-06-22 15:35:00 +08:00
parent 360a2ba2b1
commit 6056c8364a
8 changed files with 88 additions and 8 deletions
+5 -1
View File
@@ -552,9 +552,10 @@ PY
check_http_endpoint() {
local path="$1"
local max_attempts="${2:-10}"
local url="${BASE_URL%/}$path"
log "探测接口: $url"
local attempt=1 max_attempts=10 delay=2 warmup_delay=3
local attempt=1 delay=2 warmup_delay=3
log "等待服务预热 ${warmup_delay}s …"
sleep "$warmup_delay"
while [[ "$attempt" -le "$max_attempts" ]]; do
@@ -584,6 +585,9 @@ run_health_checks() {
step "探测 HTTP 接口可用性"
check_http_endpoint "/health"
check_http_endpoint "/api/v1/auth/login-key"
if [[ "$TARGET_ENV" == "dev" ]]; then
check_http_endpoint "/" 60
fi
ok "HTTP 接口全部就绪"
}