From d2baacdd4b7f3a717fa7e19820300d9ae63d4d5f Mon Sep 17 00:00:00 2001 From: lif <1835304752@qq.com> Date: Wed, 1 Apr 2026 09:31:42 +0800 Subject: [PATCH] feat(docker): add healthcheck for api, worker, and worker_beat services (#34345) Signed-off-by: majiayu000 <1835304752@qq.com> --- docker/docker-compose-template.yaml | 18 ++++++++++++++++++ docker/docker-compose.yaml | 18 ++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/docker/docker-compose-template.yaml b/docker/docker-compose-template.yaml index e55cf942c32..57584cb8295 100644 --- a/docker/docker-compose-template.yaml +++ b/docker/docker-compose-template.yaml @@ -56,6 +56,12 @@ services: volumes: # Mount the storage directory to the container, for storing user files. - ./volumes/app/storage:/app/api/storage + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5001/health"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s networks: - ssrf_proxy_network - default @@ -95,6 +101,12 @@ services: volumes: # Mount the storage directory to the container, for storing user files. - ./volumes/app/storage:/app/api/storage + healthcheck: + test: ["CMD-SHELL", "celery -A celery_entrypoint.celery inspect ping"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s networks: - ssrf_proxy_network - default @@ -126,6 +138,12 @@ services: required: false redis: condition: service_started + healthcheck: + test: ["CMD-SHELL", "celery -A app.celery inspect ping"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s networks: - ssrf_proxy_network - default diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index ed68107f46c..097fadc9593 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -765,6 +765,12 @@ services: volumes: # Mount the storage directory to the container, for storing user files. - ./volumes/app/storage:/app/api/storage + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:5001/health"] + interval: 30s + timeout: 5s + retries: 3 + start_period: 30s networks: - ssrf_proxy_network - default @@ -804,6 +810,12 @@ services: volumes: # Mount the storage directory to the container, for storing user files. - ./volumes/app/storage:/app/api/storage + healthcheck: + test: ["CMD-SHELL", "celery -A celery_entrypoint.celery inspect ping"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s networks: - ssrf_proxy_network - default @@ -835,6 +847,12 @@ services: required: false redis: condition: service_started + healthcheck: + test: ["CMD-SHELL", "celery -A app.celery inspect ping"] + interval: 30s + timeout: 10s + retries: 3 + start_period: 60s networks: - ssrf_proxy_network - default