From 77b180dc07697df98d4c56b23e064fdbd5fa7da6 Mon Sep 17 00:00:00 2001 From: zhangsz Date: Tue, 18 Feb 2025 15:15:07 +0800 Subject: [PATCH] fix: health check enhancement for all service --- build/docker/compose/docker-compose.yml | 29 +++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/build/docker/compose/docker-compose.yml b/build/docker/compose/docker-compose.yml index 3f9c5ab..6a63516 100644 --- a/build/docker/compose/docker-compose.yml +++ b/build/docker/compose/docker-compose.yml @@ -191,7 +191,7 @@ services: test: ["CMD-SHELL", "curl -f http://localhost:${WFC_SYSTEM_PORT}/actuator/health || exit 1"] interval: 30s timeout: 10s - retries: 3 + retries: 6 restart: ${RESTART_OPTION} wfc-modules-user: @@ -228,7 +228,7 @@ services: test: ["CMD-SHELL", "curl -f http://localhost:${WFC_USER_PORT}/actuator/health || exit 1"] interval: 30s timeout: 10s - retries: 3 + retries: 6 restart: ${RESTART_OPTION} wfc-modules-file: @@ -259,6 +259,11 @@ services: - WFC_FILE_PORT=${WFC_FILE_PORT} - SPRING_CONFIG_ADDITIONAL_LOCATION=optional:classpath:/,optional:file:/opt/wfc/conf/ - TZ=${TZ} + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:${WFC_FILE_PORT}/actuator/health || exit 1"] + interval: 30s + timeout: 10s + retries: 6 restart: ${RESTART_OPTION} wfc-modules-job: @@ -289,6 +294,11 @@ services: - WFC_JOB_PORT=${WFC_JOB_PORT} - SPRING_CONFIG_ADDITIONAL_LOCATION=optional:classpath:/,optional:file:/opt/wfc/conf/ - TZ=${TZ} + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:${WFC_JOB_PORT}/actuator/health || exit 1"] + interval: 30s + timeout: 10s + retries: 6 restart: ${RESTART_OPTION} wfc-modules-payment: @@ -322,6 +332,11 @@ services: - WFC_PAYMENT_PORT=${WFC_PAYMENT_PORT} - SPRING_CONFIG_ADDITIONAL_LOCATION=optional:classpath:/,optional:file:/opt/wfc/conf/ - TZ=${TZ} + healthcheck: + test: ["CMD-SHELL", "curl -f http://localhost:${WFC_PAYMENT_PORT}/actuator/health || exit 1"] + interval: 30s + timeout: 10s + retries: 6 restart: ${RESTART_OPTION} wfc-nginx: @@ -351,6 +366,16 @@ services: - WFC_SERVER_IP=${WFC_SERVER_IP} - WFC_SERVER_PORT=${WFC_SERVER_PORT} - TZ=${TZ} + healthcheck: + test: + - "CMD-SHELL" + - > + curl -f http://localhost:${WFC_SERVER_PORT}/sys && + curl -f http://localhost:${WFC_SERVER_PORT}/u || + exit 1 + interval: 30s + timeout: 5s + retries: 6 restart: ${RESTART_OPTION} networks: