diff --git a/docker-compose.yml b/docker-compose.yml index 695181e..22db02e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,11 +30,11 @@ services: DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:?POSTGRES_USER 未设置}:${POSTGRES_PASSWORD:?POSTGRES_PASSWORD 未设置}@postgres:5432/${POSTGRES_DB:-football} env_file: .env healthcheck: - test: ["CMD-SHELL", "curl -sf http://localhost:8000/health/ready || exit 1"] + test: ["CMD-SHELL", "python -c \"import urllib.request; exit(0 if urllib.request.urlopen('http://localhost:8000/health/ready', timeout=5).status==200 else 1)\" || exit 1"] interval: 10s timeout: 5s retries: 3 - start_period: 10s + start_period: 15s depends_on: postgres: condition: service_healthy