services:
  homepage:
    image: ghcr.io/gethomepage/homepage:latest
    container_name: ${HOME_ROOT_NAME}
    restart: unless-stopped
    ports:
      - "3000:3000/tcp" 
    volumes:
      - /docker/homepage/config:/app/config
      - /var/run/docker.sock:/var/run/docker.sock:ro
    networks:
      - dns_internal
      - home_internal
      - home_external
    labels:
      - "traefik.enable=${HOME_TRAEFIK_ENABLED}"
      - "traefik.docker.network=home_external"
      - "traefik.http.routers.homepage.rule=Host(`${HOME_ROOT_NAME}.${HOME_DNS_SUFFIX}`)"
      - "traefik.http.routers.homepage.entrypoints=${TRAEFIK_ENTRY_POINTS}"
      - "traefik.http.routers.homepage.tls.certresolver=${TRAEFIK_RESOLVER}"
      - "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 
