Here is my yaml that works well across various platforms Pi, Unbuntu, and Synology so far. You will have to make a lot of edits for the IP addresses and how your subnet along with other config items. I added some comments that may help. Also don't forget to provide and edit the DNScrypt proxy.toml file to your needs.
version: '2'
services:
pihole:
container_name: pihole
image: pihole/pihole:latest
hostname: pihole # <-- Update
domainname: yourdomainname # <-- Update
cap_add:
- NET_ADMIN
networks:
pihole_network:
ipv4_address: 192.168.10.x # <-- Update Address of PiHole Server
dns:
- 1.1.1.1
- 1.0.0.1
ports:
- 443/tcp
- 53/tcp
- 53/udp
- 67/udp
- 80/tcp
environment:
ADMIN_EMAIL: youremailaddress # <-- Update
TZ: America/Chicago # <-- Update to your TZ
ServerIP: 192.168.x.x # <-- Update (match ipv4_address)
WEBPASSWORD: anythingbutpassword # <-- Add password (if required)
VIRTUAL_HOST: pihole.yourdomainname # <-- Update (match hostname + domainname)
PIHOLE_DNS_: 192.168.10.x#53;192.168.10.x#53 # <-- Update (needs to point to DNScrypt proxy address
WEBUIBOXEDLAYOUT: boxed # for working on large screens
volumes:
- '/docker/dns/etc-pihole/:/etc/pihole/'
- '/docker/dns/etc-dnsmasq.d/:/etc/dnsmasq.d/'
restart: unless-stopped
dnscrypt:
container_name: dnscrypt-proxy
image: gists/dnscrypt-proxy:latest
hostname: dnscrypt
domainname: yourdomainname # <-- Update
ports:
- 53/udp
- 53/tcp
networks:
pihole_network:
ipv4_address: 192.168.10.x # <-- Update Address of DNScrypt
volumes:
- '/docker/dns/dnscrypt-proxy/dnscrypt-proxy.toml:/etc/dnscrypt-proxy/dnscrypt-proxy.toml'
restart: always
networks:
pihole_network:
driver: macvlan
driver_opts:
parent: eth0 # <-- Update if not eth0
ipam:
config:
- subnet: 192.168.10.0/24 # <-- Update if subnet different
gateway: 192.168.10.252 # <-- Update if subnet different
ip_range: 192.168.10.x/32 # <-- Update Address of Pihole container