docker: add healtchecks (#709)

Reviewed-on: #709
Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2024-02-01 21:23:44 +01:00 committed by mg
parent 5f58b33a33
commit db9284fe1c
4 changed files with 56 additions and 20 deletions

View file

@ -20,6 +20,11 @@ services:
SMTP_GENERIC_MAP: "/.*/ info@mgrote.net" SMTP_GENERIC_MAP: "/.*/ info@mgrote.net"
networks: networks:
- mail-relay - mail-relay
healthcheck:
test: ["CMD", "sh", "-c", "echo 'EHLO localhost' | nc -w 1 localhost 25 | grep -q '220 '"]
interval: 30s
timeout: 10s
retries: 3
######## Networks ######## ######## Networks ########
networks: networks:

View file

@ -21,6 +21,8 @@ services:
networks: networks:
- intern - intern
- traefik - traefik
healthcheck:
test: ["CMD", "/usr/bin/miniflux", "-healthcheck", "auto"]
labels: labels:
traefik.http.routers.miniflux.rule: Host(`miniflux.mgrote.net`) traefik.http.routers.miniflux.rule: Host(`miniflux.mgrote.net`)
traefik.enable: true traefik.enable: true
@ -46,6 +48,10 @@ services:
- db16:/var/lib/postgresql/data - db16:/var/lib/postgresql/data
networks: networks:
- intern - intern
healthcheck:
test: ["CMD", "pg_isready", "-U", "miniflux"]
interval: 10s
start_period: 30s
labels: labels:
com.centurylinklabs.watchtower.enable: true com.centurylinklabs.watchtower.enable: true

View file

@ -13,6 +13,11 @@ services:
depends_on: depends_on:
- oci-registry-ui - oci-registry-ui
- oci-registry-redis - oci-registry-redis
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:5000/v2/"]
interval: 30s
timeout: 10s
retries: 3
environment: environment:
TZ: Europe/Berlin TZ: Europe/Berlin
REGISTRY_AUTH: none REGISTRY_AUTH: none
@ -61,6 +66,11 @@ services:
MAXMEMORY POLICY: allkeys-lru MAXMEMORY POLICY: allkeys-lru
labels: labels:
com.centurylinklabs.watchtower.enable: true com.centurylinklabs.watchtower.enable: true
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 30s
timeout: 10s
retries: 3
oci-registry-ui: oci-registry-ui:
restart: always restart: always
@ -77,6 +87,11 @@ services:
networks: networks:
- traefik - traefik
- intern - intern
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost"]
interval: 30s
timeout: 10s
retries: 3
labels: labels:
traefik.http.routers.registry-ui.rule: Host(`registry.mgrote.net`)&&PathPrefix(`/ui`) # mache unter /ui erreichbar, damit wird demPfad dieser Prefix hinzugefügt, die Anwendung "hört" dort abrer nicht traefik.http.routers.registry-ui.rule: Host(`registry.mgrote.net`)&&PathPrefix(`/ui`) # mache unter /ui erreichbar, damit wird demPfad dieser Prefix hinzugefügt, die Anwendung "hört" dort abrer nicht
traefik.http.routers.registry-ui.middlewares: registry-ui-strip-prefix,registry-ui-ipwhitelist # also entferne den Prefix danach wieder traefik.http.routers.registry-ui.middlewares: registry-ui-strip-prefix,registry-ui-ipwhitelist # also entferne den Prefix danach wieder

View file

@ -34,6 +34,11 @@ services:
networks: networks:
- mail-relay - mail-relay
- unifi-internal - unifi-internal
healthcheck:
test: ["CMD", "curl", "-f", "--insecure", "https://localhost:8443"]
interval: 30s
timeout: 10s
retries: 3
unifi-db: unifi-db:
# Starte Container OHNE init-script # Starte Container OHNE init-script
@ -52,6 +57,11 @@ services:
com.centurylinklabs.watchtower.enable: true com.centurylinklabs.watchtower.enable: true
networks: networks:
- unifi-internal - unifi-internal
healthcheck:
test: ["CMD", "mongosh", "--eval", "db.stats().ok"]
interval: 30s
timeout: 10s
retries: 3
######## Volumes ######## ######## Volumes ########
volumes: volumes: