-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathdocker-compose.yml
59 lines (58 loc) · 2.03 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
version: '3.9'
services:
pihole:
container_name: pihole
image: pihole/pihole:2023.03.1 # <- update image version here, see: https://github.com/pi-hole/docker-pi-hole/releases
hostname: pihole.local
depends_on:
- unbound
restart: unless-stopped
deploy:
resources: # <- these settings are optional, but can help to limit resource reservations
limits:
memory: 768M
reservations:
memory: 256M
ports:
- "8080:80/tcp" # web ui -> http://localhost:8080/admin
- "53:53/tcp" # DNS tcp port is used as fallback for longer dns messages
- "53:53/udp" # DNS port
# RECOMMENDED: Uncomment and adapt if you want to persist pihole configurations after restart
# volumes:
# - "/var/lib/docker/volumes/pihole/pihole:/etc/pihole/"
# - "/var/lib/docker/volumes/pihole/dnsmasq.d:/etc/dnsmasq.d/"
environment:
WEBPASSWORD: ${WEBPASSWORD}
FTLCONF_LOCAL_IPV4: ${HOST_IP_V4_ADDRESS} # <-- match ipv4_address of host
TZ: ${TIMEZONE}
PIHOLE_DNS_: 172.21.200.3#53 # forward to unbound
DNSSEC: true
WEBTHEME: default-light
dns:
- 127.0.0.1
- 9.9.9.9 # Quad9
- 1.1.1.1 # CloudFlare
networks:
pihole_dns_network:
ipv4_address: 172.21.200.2 # <-- use this ip as dns when connected to pihole_dns_network (i.e. within a docker network)
unbound:
build: ./unbound
container_name: unbound
hostname: unbound.local
restart: unless-stopped
ports:
- "5335:53/tcp" # expose a different port (5335) so you can use it directly
- "5335:53/udp"
networks:
pihole_dns_network:
ipv4_address: 172.21.200.3 # <-- this is used by pihole as upstream DNS
networks:
# Define a custom subnet for pihole so that unbound can be an upstream DNS on port 53
pihole_dns_network:
name: "pihole_dns_network"
ipam:
driver: default
config:
- subnet: 172.21.200.0/24
gateway: 172.21.200.1
ip_range: 172.21.200.1/24 # 172.21.200.1 - 172.21.200.254