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:
parent
5f58b33a33
commit
db9284fe1c
4 changed files with 56 additions and 20 deletions
|
@ -1,25 +1,30 @@
|
||||||
version: '3.3'
|
version: '3.3'
|
||||||
services:
|
services:
|
||||||
postfix:
|
postfix:
|
||||||
image: "registry.mgrote.net/postfix:master@sha256:fa2af0bc8edacfff05be461370c1591d480ae48ce3027a8322f80dba950cb9a7"
|
image: "registry.mgrote.net/postfix:master@sha256:fa2af0bc8edacfff05be461370c1591d480ae48ce3027a8322f80dba950cb9a7"
|
||||||
container_name: mail-relay
|
container_name: mail-relay
|
||||||
restart: always
|
restart: always
|
||||||
labels:
|
labels:
|
||||||
com.centurylinklabs.watchtower.enable: true
|
com.centurylinklabs.watchtower.enable: true
|
||||||
ports:
|
ports:
|
||||||
- 1025:25
|
- 1025:25
|
||||||
environment:
|
environment:
|
||||||
SMTP_SERVER: smtp.strato.de
|
SMTP_SERVER: smtp.strato.de
|
||||||
SMTP_USERNAME: info@mgrote.net
|
SMTP_USERNAME: info@mgrote.net
|
||||||
SMTP_PASSWORD: "{{ lookup('keepass', 'strato_smtp_password', 'password') }}"
|
SMTP_PASSWORD: "{{ lookup('keepass', 'strato_smtp_password', 'password') }}"
|
||||||
SERVER_HOSTNAME: mgrote.net
|
SERVER_HOSTNAME: mgrote.net
|
||||||
# DEBUG: "yes" # literal
|
# DEBUG: "yes" # literal
|
||||||
ALWAYS_ADD_MISSING_HEADERS: "no" # literal
|
ALWAYS_ADD_MISSING_HEADERS: "no" # literal
|
||||||
# LOG_SUBJECT: "yes" # literal
|
# LOG_SUBJECT: "yes" # literal
|
||||||
INET_PROTOCOL: ipv4
|
INET_PROTOCOL: ipv4
|
||||||
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:
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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:
|
||||||
|
|
Loading…
Reference in a new issue