services:
    homeassistant:
        container_name: homeassistant
        environment:
            PUID: 1000
            PGID: 1000
            TZ: America/Denver
            UMASK_SET: 22
        image: ghcr.io/home-assistant/home-assistant:stable
        labels:
            traefik.docker.network: traefik
            traefik.enable: true
            traefik.http.routers.homeassistant.entrypoints: websecure
            traefik.http.routers.homeassistant.rule: Host(`homeassistant.alexlebens.net`)
            traefik.http.routers.homeassistant.service: homeassistant
            traefik.http.services.homeassistant.loadbalancer.server.port: 8123
        logging:
            driver: json-file
            options:
                max-size: 50m
                max-file: "3"
        networks:
            traefik: null
        restart: unless-stopped
        volumes:
            - config:/config
            - /etc/localtime:/etc/localtime:ro

networks:
    traefik:
        name: traefik
        external: true

volumes:
    config:
        driver: local
        driver_opts:
            type: none
            o: bind
            device: /var/lib/docker/volumes/partition/homeassistant_config