-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
119 lines (112 loc) · 3.51 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
version: "3"
# IMPORTANT:
# If you plan on using IPv6 then you'll need to manually create this network
#
# docker network create --driver bridge --ipv6 --subnet fd01::/64 --subnet 172.20.0.0/24 pihole_pihole_net --attachable
#
# You'll also want the IPv6 NAT docker container to help out
#
# docker run -d --restart=always -v /var/run/docker.sock:/var/run/docker.sock:ro --cap-drop=ALL --cap-add=NET_RAW --cap-add=NET_ADMIN --cap-add=SYS_MODULE --net=host --name ipv6nat robbertkl/ipv6nat
# Manually create a network so we can use static IPs on the backend
networks:
pihole_net:
ipam:
config:
- subnet: 172.20.0.0/24
# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
pihole:
container_name: pihole
hostname: pihole
image: pihole/pihole:v5.8.1
ports:
- "53:53/tcp"
- "53:53/udp"
- "67:67/udp"
- "80:80/tcp"
- "443:443/tcp"
env_file:
- .env
environment:
TZ: 'America/New_York'
PIHOLE_DNS_: "172.20.0.3#8053;172.20.0.2#5054"
# These need to be set because I'm running PiHole behind docker
ServerIP: "192.168.1.2"
ServerIPv6: "2600:6c65:757f:b21f:beef:beef:beef:beef"
# My network gets chatty, only keeping two days makes PiHole a little more responsive
MAXDBDAYS: "2"
# Volumes store your data between container upgrades
volumes:
- './etc-pihole/:/etc/pihole/'
- './etc-dnsmasq.d/:/etc/dnsmasq.d/'
# - '/etc/hosts:/etc/hosts:ro'
dns:
- 127.0.0.1
- 1.1.1.1
# Recommended but not required (DHCP needs NET_ADMIN)
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN
restart: unless-stopped
networks:
pihole_net:
ipv4_address: 172.20.0.10
depends_on:
- nextdns-proxy
- cloudflared
- unifi-dns
sysctls:
- net.ipv6.conf.all.disable_ipv6=0
cloudflared:
container_name: cloudflared
hostname: cloudflared
image: crazymax/cloudflared:latest
env_file:
- .env
environment:
TZ: 'America/New_York'
TUNNEL_DNS_UPSTREAM: "https://dns.nextdns.io/45dea4/Cloudflared,https://9.9.9.9/dns-query,https://1.1.1.1/dns-query,https://1.0.0.1/dns-query"
restart: unless-stopped
networks:
pihole_net:
ipv4_address: 172.20.0.2
nextdns-proxy:
image: "terafin/nextdns-proxy:latest"
container_name: nextdns-proxy
hostname: nextdns-proxy
# grab the environment data from .env
env_file:
- .env
# environment: # Note, these are ALL optional
# NEXTDNS_CONFIG: <Your NextDNS Config ID>
# NEXTDNS_FORWARDING_DOMAIN: <Your Local Domain Name>
# NEXTDNS_FORWARDING_DNSIP: <Your Local Router Address>
restart: unless-stopped
networks:
pihole_net:
ipv4_address: 172.20.0.3
volumes:
- './nextdns/run.sh:/var/nextdns/run.sh:ro'
unifi-dns:
image: unifi-dns
build: unifi-dns
container_name: unifi-dns
hostname: unifi-dns
restart: unless-stopped
env_file:
- .env.unifi-dns
restart: always
volumes:
- './unifi-dns/extra_hosts.txt:/extra_hosts.txt:ro'
cap_add:
- NET_ADMIN
networks:
pihole_net:
ipv4_address: 172.20.0.4
# ipv6-discovery:
# image: pridkett/ipv6-discovery:latest
# container_name: ipv6-discovery
# hostname: ipv6-discovery
# restart: unless-stopped
# volumes:
# - '/home/pwagstro/.ssh/known_hosts:/root/.ssh/known_hosts:ro'