docker: tilføj healthcheck til HA + autoheal-container mod frosne hæng
This commit is contained in:
@@ -11,3 +11,24 @@ services:
|
||||
restart: always
|
||||
environment:
|
||||
- TZ=Europe/Copenhagen
|
||||
labels:
|
||||
- "autoheal=true"
|
||||
healthcheck:
|
||||
# Tjekker at HA's web-API faktisk svarer (ikke kun at processen kører)
|
||||
test: ["CMD", "curl", "-fs", "http://localhost:8123/manifest.json"]
|
||||
interval: 30s # tjek hvert 30. sekund
|
||||
timeout: 10s # svar skal komme inden 10 sek
|
||||
retries: 3 # 3 fejl i træk => unhealthy
|
||||
start_period: 120s # giv HA 2 min til at boote inden tjek tæller
|
||||
|
||||
autoheal:
|
||||
container_name: autoheal
|
||||
image: willfarrell/autoheal:latest
|
||||
restart: always
|
||||
environment:
|
||||
- AUTOHEAL_CONTAINER_LABEL=autoheal # genstart kun containere med label autoheal=true
|
||||
- AUTOHEAL_INTERVAL=15 # tjek health-status hvert 15. sekund
|
||||
- AUTOHEAL_START_PERIOD=300 # vent 5 min efter egen opstart inden overvågning
|
||||
- TZ=Europe/Copenhagen
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
|
||||
Reference in New Issue
Block a user