From a496003bfb032e7db5e450d3aa4772da8f4e55e0 Mon Sep 17 00:00:00 2001 From: Debendra Oli Date: Fri, 8 Nov 2024 11:32:18 +0545 Subject: [PATCH] add: healthcheck --- docker-compose.yaml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/docker-compose.yaml b/docker-compose.yaml index 2c4d9fe..a7dc931 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -8,6 +8,11 @@ services: - relay-socket:${SOCKET_DIR:-/var/run/relayer} labels: service: "centralized-relay" + healthcheck: + test: ["CMD", "test", "-S", "${SOCKET_DIR:-/var/run/relayer}/relay.sock"] + interval: 30s + timeout: 10s + retries: 3 environment: - AWS_ACCESS_KEY_ID - AWS_SECRET_ACCESS_KEY @@ -16,7 +21,7 @@ services: networks: relayer: dashboard: - image: iconcommunity/relayer-admin-dashboard:${NGINX_IMAGE_VERSION:-latest} + image: iconcommunity/relayer-admin-dashboard:${DASHBOARD_IMAGE_VERSION:-latest} restart: ${RESTART_POLICY:-unless-stopped} ports: - "${HTTP_PORT:-80}:80" @@ -30,6 +35,15 @@ services: - relay-socket:${SOCKET_DIR:-/var/run/relayer} - /proc:/host/proc:ro - /sys:/host/sys:ro + healthcheck: + test: + - "CMD" + - "curl" + - "-f" + - "http://dashboard:${DASHBOARD_PORT:-3000}/api/health" + interval: 30s + timeout: 10s + retries: 3 labels: service: "relayer-admin-dashboard" environment: