From 1aad1fa4da05fdd3c6964ebc6de1a7bf41b27948 Mon Sep 17 00:00:00 2001 From: Bart Geesink Date: Thu, 2 Nov 2023 21:17:21 +0100 Subject: [PATCH] Docker: Add healthcheck to the traefik container --- roles/docker/tasks/main.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index 4ca7efd6e..7c01d344e 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -61,18 +61,24 @@ restart_policy: "always" networks: - name: "loadbalancer" - command: "--providers.docker --providers.docker.network=loadbalancer --entrypoints.websecure.address=:443 --providers.file.directory=/config/config/ --providers.docker.exposedbydefault=false" + command: "--providers.docker --providers.docker.network=loadbalancer --entrypoints.websecure.address=:443 --providers.file.directory=/config/config/ --providers.docker.exposedbydefault=false --accesslog=true --ping" volumes: - /var/run/docker.sock:/var/run/docker.sock - /opt/openconext/traefik/:/config/ comparisons: - published_ports: strict + published_ports: strict networks: strict + healthcheck: + test: ["CMD", "traefik", "healthcheck", "--ping"] + interval: 1ms + timeout: 10s + retries: 3 + start_period: 30s - name: Place the iptables file ansible.builtin.template: src: ip4tables.sh.j2 - dest: /usr/local/sbin/ip4tables.sh + dest: /usr/local/sbin/ip4tables.sh mode: "0750" owner: root