Skip to content

Instantly share code, notes, and snippets.

@gam-phon
Last active April 24, 2022 09:42
Show Gist options
  • Star 11 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save gam-phon/7c1a96519414fb58ff3dae67f8f2ba22 to your computer and use it in GitHub Desktop.
Save gam-phon/7c1a96519414fb58ff3dae67f8f2ba22 to your computer and use it in GitHub Desktop.
pi-hole and DNS over HTTPS docker-compose
version: "3"
# Thanks to https://visibilityspots.org/dockerized-cloudflared-pi-hole.html
# echo "alias dns-up='cd /path/to/folder; docker-compose up -d'" >> ~/.bash_profile
services:
dns-over-https:
container_name: dns-over-https
image: fardog/secureoperator:latest # google dns
# image: visibilityspots/cloudflared:amd64 # cloudflare dns
restart: unless-stopped
networks:
pihole_net:
ipv4_address: 10.0.0.2
dns:
- 8.8.8.8
- 8.8.4.4
pi-hole:
container_name: pi-hole
image: pihole/pihole:4.1.1_amd64
restart: unless-stopped
ports:
- "8111:80/tcp"
- "53:53/tcp"
- "53:53/udp"
environment:
- ServerIP=10.0.0.3
- DNS1='10.0.0.2#53'
- DNS2=''
- IPv6=false
- TZ=CEST-2
- DNSMASQ_LISTENING=all
- WEBPASSWORD=admin
networks:
pihole_net:
ipv4_address: 10.0.0.3
dns:
- 127.0.0.1
- 8.8.8.8
cap_add:
- NET_ADMIN
networks:
pihole_net:
driver: bridge
ipam:
config:
- subnet: 10.0.0.0/29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment