fix(docker): gate deriver startup on api healthcheck (#689)

This commit is contained in:
Xiangzhe 2026-05-19 22:29:08 +08:00 committed by GitHub
parent b8bfe06285
commit b0f0295fd1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 14 additions and 0 deletions

View File

@ -21,6 +21,18 @@ services:
condition: service_healthy
ports:
- "127.0.0.1:8000:8000"
healthcheck:
test:
[
"CMD",
"/app/.venv/bin/python",
"-c",
"import urllib.request; urllib.request.urlopen('http://localhost:8000/health', timeout=2).read()",
]
interval: 5s
timeout: 5s
retries: 5
start_period: 10s
# -- Development: mount source for live reload --
# volumes:
# - .:/app
@ -40,6 +52,8 @@ services:
dockerfile: Dockerfile
entrypoint: ["/app/.venv/bin/python", "-m", "src.deriver"]
depends_on:
api:
condition: service_healthy
database:
condition: service_healthy
redis: