From b0f0295fd1d6a46e460ed924d8a72dc9ae3cb16a Mon Sep 17 00:00:00 2001 From: Xiangzhe <32761048+xz-dev@users.noreply.github.com> Date: Tue, 19 May 2026 22:29:08 +0800 Subject: [PATCH] fix(docker): gate deriver startup on api healthcheck (#689) --- docker-compose.yml.example | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docker-compose.yml.example b/docker-compose.yml.example index c52699f0..51b279e7 100644 --- a/docker-compose.yml.example +++ b/docker-compose.yml.example @@ -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: