Files
N22/docker/docker-compose.homeassistant.yml
T

35 lines
1.2 KiB
YAML

services:
home-assistant:
container_name: homeassistant
image: homeassistant/home-assistant:latest
volumes:
- /volume1/homeassistant:/config
- /volume1/docker/homeassistant/backups:/backups
devices:
- /dev/ttyUSB0:/dev/ttyUSB0
network_mode: host
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