feat: add dependency readiness checks

This commit is contained in:
ik
2026-09-04 07:38:34 +07:00
parent d131662d5f
commit 3b26c59219
9 changed files with 179 additions and 11 deletions
+13 -2
View File
@@ -22,6 +22,11 @@ services:
ports:
- "9000:9000"
- "9001:9001"
healthcheck:
test: ["CMD", "curl", "-fsS", "http://localhost:9000/minio/health/live"]
interval: 5s
timeout: 3s
retries: 10
volumes:
- minio_data:/data
@@ -40,16 +45,17 @@ services:
OFFICIAL_RECORDS_URL: ${OFFICIAL_RECORDS_URL:-https://rf4game.de/records/region/RU/}
OFFICIAL_RECORDS_REGION: ${OFFICIAL_RECORDS_REGION:-RU}
OFFICIAL_RECORDS_CATEGORY: ${OFFICIAL_RECORDS_CATEGORY:-records}
OFFICIAL_IMPORT_REQUIRED: ${OFFICIAL_IMPORT_REQUIRED:-false}
RATE_LIMIT_SECRET: ${RATE_LIMIT_SECRET:-change-rate-limit-secret}
depends_on:
db:
condition: service_healthy
minio:
condition: service_started
condition: service_healthy
ports:
- "8000:8000"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"]
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/ready')"]
interval: 5s
timeout: 3s
retries: 12
@@ -64,6 +70,11 @@ services:
condition: service_healthy
ports:
- "4321:4321"
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://localhost:4321').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))"]
interval: 5s
timeout: 3s
retries: 10
importer:
build: