services:
  homeassistant:
    image: ghcr.io/home-assistant/home-assistant:stable
    restart: unless-stopped
    ports:
      - 8123
    volumes:
      - ../files/configuration.yaml:/config/configuration.yaml
      - ../files/automations.yaml:/config/automations.yaml
      - ../files/scripts.yaml:/config/scripts.yaml
      - ../files/scenes.yaml:/config/scenes.yaml
      - /opt/homeassistant:/config
      - /etc/localtime:/etc/localtime:ro
      - /run/dbus:/run/dbus:ro
    healthcheck:
      test: ["CMD", "curl", "-f", "http://homeassistant:8123/"]
      interval: 60s
      retries: 5
      start_period: 300s
      timeout: 2s
