From a26badbff8b65dcb69286bbbd00db4be8fe5ce50 Mon Sep 17 00:00:00 2001 From: Bart Geesink Date: Mon, 8 Jan 2024 20:04:47 +0100 Subject: [PATCH] SPD: Add healthchecks --- roles/spdashboard/tasks/main.yml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/roles/spdashboard/tasks/main.yml b/roles/spdashboard/tasks/main.yml index 184dd3152..33cd1e0cc 100644 --- a/roles/spdashboard/tasks/main.yml +++ b/roles/spdashboard/tasks/main.yml @@ -26,12 +26,17 @@ pull: true restart_policy: "always" networks: - - name: "spdashboard" - name: "loadbalancer" labels: traefik.http.routers.spdashboard.rule: "Host(`{{ spdashboard_domain }}`)" traefik.http.routers.spdashboard.tls: "true" traefik.enable: "true" + healthcheck: + test: ["CMD", "curl", "--fail" , "http://localhost" ] + interval: 10s + timeout: 10s + retries: 3 + start_period: 10s - name: Create the php-fpm container @@ -42,4 +47,10 @@ pull: true restart_policy: "always" networks: - - name: "spdashboard" + - name: "loadbalancer" + healthcheck: + test: ["CMD", "cgi-fcgi", "-bind" , "-connect", "127.0.0.1:9000" ] + interval: 10s + timeout: 10s + retries: 3 + start_period: 10s