services:
  app:
    image: pihole/pihole:latest
    restart: always
    ports:
      - "53:53/tcp"
      - "53:53/udp"
    volumes:
      - "{{ basedir }}/etc:/etc/pihole"
      - "{{ basedir }}/dnsmasq:/etc/dnsmasq.d"
      - "/dev/null:/var/log/pihole.log"
      - "/dev/null:/var/log/pihole-FTL.log"
    hostname: pihole
    environment:
      TZ: 'Europe/Berlin'
      TAIL_FTL_LOG: 0
      FTLCONF_LOCAL_IPV4: '{{ int_ip4 }}'
      WEBPASSWORD: '{{ admin_password }}'
    labels:
      - traefik.enable=true
      - traefik.http.routers.{{ servicename }}.entrypoints=websecure
      - traefik.http.routers.{{ servicename }}.rule=Host(`{{ domain }}`)
      - traefik.http.services.{{ servicename }}.loadBalancer.server.port=80
    networks:
      - default
      - web

networks:
  web:
    external: true