Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

feat(docker): add healthcheck for api, worker, and worker_beat services (#34345)

lifd2baacdd4b7f
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