diff --git a/docker-compose/nextcloud/docker-compose.yml.j2 b/docker-compose/nextcloud/docker-compose.yml.j2 index c547fe26..a920b414 100644 --- a/docker-compose/nextcloud/docker-compose.yml.j2 +++ b/docker-compose/nextcloud/docker-compose.yml.j2 @@ -18,6 +18,16 @@ services: MYSQL_INITDB_SKIP_TZINFO: 1 networks: - intern + healthcheck: + interval: 30s + retries: 3 + test: + [ + "CMD", + "healthcheck.sh", + "--connect", + ] + timeout: 30s labels: com.centurylinklabs.watchtower.enable: true @@ -39,6 +49,11 @@ services: command: "redis-server --requirepass {{ lookup('keepass', 'nextcloud_redis_host_password', 'password') }}" labels: com.centurylinklabs.watchtower.enable: true + healthcheck: + test: ["CMD", "redis-cli", "--pass", "{{ lookup('keepass', 'nextcloud_redis_host_password', 'password') }}", "--no-auth-warning", "ping"] + interval: 5s + timeout: 2s + retries: 3 ######## cron ######## nextcloud-cron: @@ -91,6 +106,11 @@ services: - intern - traefik - mail-relay + healthcheck: + test: ["CMD", "curl", "-f", "--insecure", "http://localhost:80"] + interval: 30s + timeout: 10s + retries: 3 labels: com.centurylinklabs.watchtower.enable: true com.centurylinklabs.watchtower.depends-on: nextcloud-redis,nextcloud-db diff --git a/docker-compose/traefik/docker-compose.yml.j2 b/docker-compose/traefik/docker-compose.yml.j2 index e3e6a683..d5c7d937 100644 --- a/docker-compose/traefik/docker-compose.yml.j2 +++ b/docker-compose/traefik/docker-compose.yml.j2 @@ -21,6 +21,11 @@ services: TZ: Europe/Berlin labels: com.centurylinklabs.watchtower.enable: true + healthcheck: + test: ["CMD", "traefik", "healthcheck", "--ping"] + interval: 30s + timeout: 10s + retries: 3 ######## nforwardauth ######## nforwardauth: @@ -47,6 +52,12 @@ services: - "./passwd:/passwd:ro" # Mount local passwd file at /passwd as read only networks: - traefik + healthcheck: + test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:3000/"] + interval: 30s + timeout: 10s + retries: 3 + ######## Networks ######## networks: diff --git a/docker-compose/traefik/traefik.yml b/docker-compose/traefik/traefik.yml index 10cd500d..6cb83cc9 100644 --- a/docker-compose/traefik/traefik.yml +++ b/docker-compose/traefik/traefik.yml @@ -37,6 +37,8 @@ api: insecure: true dashboard: true # unter Port 8081 erreichbar +ping: {} # für healthcheck + #experimental: # plugins: # ldapAuth: