From 03176d38b412f265ada0c0c8021a0a4163e95e44 Mon Sep 17 00:00:00 2001 From: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> Date: Wed, 23 Apr 2025 19:27:30 +0200 Subject: [PATCH] enh: add minimum healthcheck to docker compose Signed-off-by: thiswillbeyourgithub <26625900+thiswillbeyourgithub@users.noreply.github.com> --- docker-compose.beta.yml | 5 +++++ docker-compose.dev.yml | 5 +++++ docker-compose.yml | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/docker-compose.beta.yml b/docker-compose.beta.yml index 94b5e86a..b936de9e 100644 --- a/docker-compose.beta.yml +++ b/docker-compose.beta.yml @@ -32,6 +32,11 @@ services: - net.ipv6.conf.all.disable_ipv6=0 - net.ipv6.conf.all.forwarding=1 - net.ipv6.conf.default.forwarding=1 + healthcheck: + test: /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1" + interval: 1m + timeout: 5s + retries: 3 networks: wg: diff --git a/docker-compose.dev.yml b/docker-compose.dev.yml index 8da0a83c..10e2674f 100644 --- a/docker-compose.dev.yml +++ b/docker-compose.dev.yml @@ -21,6 +21,11 @@ services: - INIT_PORT=51820 - INIT_USERNAME=testtest - INIT_PASSWORD=Qweasdyxcv!2 + healthcheck: + test: /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1" + interval: 1m + timeout: 5s + retries: 3 # folders should be generated inside container volumes: diff --git a/docker-compose.yml b/docker-compose.yml index 5a1580cf..ca58041d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -43,3 +43,8 @@ services: sysctls: - net.ipv4.ip_forward=1 - net.ipv4.conf.all.src_valid_mark=1 + healthcheck: + test: /usr/bin/timeout 5s /bin/sh -c "/usr/bin/wg show | /bin/grep -q interface || exit 1" + interval: 1m + timeout: 5s + retries: 3