version: '3.9'

services:
  homeassistant:
    image: ghcr.io/home-assistant/home-assistant:2024.8.3
    environment:
      - TZ=America/New_York
    volumes:
      - ha_config:/config
    networks:
      - traefik-public
    deploy:
      placement:
        constraints:
          - "node.labels.role==core"
      labels:
        - traefik.enable=true
        - traefik.http.routers.ha.rule=Host(`ha.localhost`)
        - traefik.http.routers.ha.entrypoints=websecure
        - traefik.http.routers.ha.tls=true
        - traefik.http.services.ha.loadbalancer.server.port=8123

volumes:
  ha_config:
    driver: local
    driver_opts:
      type: nfs
      o: addr=omv800.local,nolock,soft,rw
      device: :/export/homeassistant/config

networks:
  traefik-public:
    external: true
