services: dnscrypt-proxy: # cloudflared dropped its DNS-over-HTTPS proxy mode in 2026.2.0, # dnscrypt-proxy forwards queries to Cloudflare over DoH instead image: klutchell/dnscrypt-proxy:latest container_name: dnscrypt-proxy ports: - "5054:5054/tcp" - "5054:5054/udp" volumes: - ./dnscrypt-proxy/dnscrypt-proxy.toml:/config/dnscrypt-proxy.toml:ro restart: always networks: dns-net: ipv4_address: 172.20.0.2 pihole: container_name: pihole image: pihole/pihole:latest ports: - "53:53/tcp" - "53:53/udp" - "67:67/udp" - "8080:80/tcp" - "8443:443/tcp" environment: - TZ=${TIMEZONE} # Pi-hole v6 settings, see https://docs.pi-hole.net/docker/configuration/ - FTLCONF_webserver_api_password=${PIHOLE_PW} - FTLCONF_dns_upstreams=172.20.0.2#5054 - FTLCONF_dns_listeningMode=all # conditional forwarding: enabled,network CIDR,router IP,local domain - FTLCONF_dns_revServers=true,${PIHOLE_REVERSE_DNS},${PIHOLE_ROUTER_IP},${PIHOLE_NETWORK_DOMAIN} volumes: # store your data between container upgrades - "/etc/pihole/:/etc/pihole/" cap_add: - NET_ADMIN # Recommended but not required (DHCP needs NET_ADMIN) https://github.com/pi-hole/docker-pi-hole#note-on-capabilities - SYS_TIME # Required by the Pi-hole NTP client - SYS_NICE # Optional, lets Pi-hole raise its process priority depends_on: - "dnscrypt-proxy" restart: always networks: - dns-net networks: dns-net: ipam: config: - subnet: 172.20.0.0/24