feat(docker-compose): Add example for health check between two services
This commit is contained in:
@@ -5,6 +5,9 @@ services:
|
||||
networks:
|
||||
grafana-default:
|
||||
profiles: ["full", "grafana"]
|
||||
depends_on:
|
||||
nginx:
|
||||
condition: service_healthy
|
||||
extends:
|
||||
file: common-settings.yml
|
||||
service: common-settings
|
||||
@@ -23,6 +26,12 @@ services:
|
||||
networks:
|
||||
grafana-default:
|
||||
profiles: ["full", "nginx"]
|
||||
healthcheck:
|
||||
test: ["CMD", "fping", "--count=1", "${GRAFANA_VIP}", "--period=500", "--quiet"]
|
||||
interval: 3s
|
||||
timeout: 1s
|
||||
retries: 60
|
||||
start_period: 2s
|
||||
extends:
|
||||
file: common-settings.yml
|
||||
service: common-settings
|
||||
|
@@ -6,6 +6,7 @@ CONTEXT=cncf
|
||||
# ---
|
||||
# GRAFANA_VERSION=x.y.z
|
||||
# NGINX_VERSION=x.y.z
|
||||
# GRAFANA_VIP=10.1.1.2
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user