services:
  npm:
    image: jc21/nginx-proxy-manager:2.13.6
    container_name: npm
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "${WG_IP}:81:81"
    volumes:
      - /opt/hub/state/docker/npm/data:/data
      - /opt/hub/state/docker/npm/letsencrypt:/etc/letsencrypt
    healthcheck:
      test: [ "CMD-SHELL", "curl -s -o /dev/null -w '%{http_code}' http://127.0.0.1:81/ | grep -qE '200|301|302|401' || exit 1" ]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 20s

  pihole:
    image: pihole/pihole:2026.02.0
    container_name: pihole
    restart: unless-stopped
    env_file:
      - /opt/hub/state/env/core.env
    environment:
      TZ: ${TZ}
      FTLCONF_dns_listeningMode: all
    volumes:
      - /opt/hub/state/docker/pihole/etc-pihole:/etc/pihole
      - /opt/hub/state/docker/pihole/etc-dnsmasq.d:/etc/dnsmasq.d
    dns:
      - 1.1.1.1
      - 1.0.0.1
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "${WG_IP}:8053:80/tcp"
    cap_add:
      - NET_ADMIN
    healthcheck:
      test: [ "CMD-SHELL", "pihole status | grep -qi 'blocking is enabled' || exit 1" ]
      interval: 30s
      timeout: 10s
      retries: 5
      start_period: 20s
