compose.yaml 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. services:
  2. dnscrypt-proxy:
  3. # cloudflared dropped its DNS-over-HTTPS proxy mode in 2026.2.0,
  4. # dnscrypt-proxy forwards queries to Cloudflare over DoH instead
  5. image: klutchell/dnscrypt-proxy:latest
  6. container_name: dnscrypt-proxy
  7. ports:
  8. - "5054:5054/tcp"
  9. - "5054:5054/udp"
  10. volumes:
  11. - ./dnscrypt-proxy/dnscrypt-proxy.toml:/config/dnscrypt-proxy.toml:ro
  12. restart: always
  13. networks:
  14. dns-net:
  15. ipv4_address: 172.20.0.2
  16. pihole:
  17. container_name: pihole
  18. image: pihole/pihole:latest
  19. ports:
  20. - "53:53/tcp"
  21. - "53:53/udp"
  22. - "67:67/udp"
  23. - "8080:80/tcp"
  24. - "8443:443/tcp"
  25. environment:
  26. - TZ=${TIMEZONE}
  27. # Pi-hole v6 settings, see https://docs.pi-hole.net/docker/configuration/
  28. - FTLCONF_webserver_api_password=${PIHOLE_PW}
  29. - FTLCONF_dns_upstreams=172.20.0.2#5054
  30. - FTLCONF_dns_listeningMode=all
  31. # conditional forwarding: enabled,network CIDR,router IP,local domain
  32. - FTLCONF_dns_revServers=true,${PIHOLE_REVERSE_DNS},${PIHOLE_ROUTER_IP},${PIHOLE_NETWORK_DOMAIN}
  33. volumes: # store your data between container upgrades
  34. - "/etc/pihole/:/etc/pihole/"
  35. cap_add:
  36. - NET_ADMIN # Recommended but not required (DHCP needs NET_ADMIN) https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
  37. - SYS_TIME # Required by the Pi-hole NTP client
  38. - SYS_NICE # Optional, lets Pi-hole raise its process priority
  39. depends_on:
  40. - "dnscrypt-proxy"
  41. restart: always
  42. networks:
  43. - dns-net
  44. networks:
  45. dns-net:
  46. ipam:
  47. config:
  48. - subnet: 172.20.0.0/24