services:
  homepage:
    image: ghcr.io/gethomepage/homepage:latest
    container_name: homepage
    restart: unless-stopped
    volumes:
      # Gluster Path for HA
      - /shared/homepage/config:/app/config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - home_internal
      - home_external
      - dns_internal
    labels:
      - "traefik.enable=${HOME_TRAEFIK_ENABLED}"
      # TRAEFIK MUST BE ON THIS NETWORK:
      - "traefik.docker.network=home_external"
      
      # Router
      - "traefik.http.routers.homepage.rule=Host(`${HOME_ROOT_NAME}.${TRAEFIK_DNS_SUFFIX}`)"
      - "traefik.http.routers.homepage.entrypoints=websecure"
      - "traefik.http.routers.homepage.tls=true"
      - "traefik.http.routers.homepage.tls.certresolver=dns_resolver"
      # Service
      - "traefik.http.services.homepage.loadbalancer.server.port=3000"
    environment:
      - HOMEPAGE_ALLOWED_HOSTS=*

networks:
  home_internal:
    driver: bridge
  home_external:
    driver: bridge
  dns_internal:
    external: true