forked from IAmStoxe/wirehole
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
85 lines (79 loc) · 2.7 KB
/
docker-compose.yml
File metadata and controls
85 lines (79 loc) · 2.7 KB
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
version: "3"
networks:
private_network:
ipam:
driver: default
config:
- subnet: 10.2.0.0/24
services:
unbound:
image: mvance/unbound:latest
container_name: unbound
restart: unless-stopped
hostname: "unbound"
volumes:
- "./unbound:/opt/unbound/etc/unbound/"
networks:
private_network:
ipv4_address: 10.2.0.200
wireguard:
depends_on: [unbound, pihole]
image: lscr.io/linuxserver/wireguard:latest # Updated image that pulls for correct platform
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
- PUID=1000 # Host user group
- PGID=1000
- TZ=America/Chicago # Change to your timezone
- SERVERPORT=51820
- SERVERURL=myCloudflareTunnel.domain.com #optional - For use with DDNS. I used a Cloudflare Tunnel (Uncomment to use)
- PEERS=2 # How many peers to generate for you (clients). Alternatly you can do: clientName1,clientName2,clientPhoneName,etc
- PEERDNS=10.2.0.100 # Set it to point to pihole
- INTERNAL_SUBNET=10.6.0.0
- INTERFACE=eth0
- PERSISTENTKEEPALIVE_PEERS=all # Seems to help with network connectivity
# These PostUp and PostDown variables help with an issue of eth+ and %i being generated in the wg0.conf file
- POSTUP=iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
- POSTDOWN=iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE
volumes:
- ./wireguard:/config
- /lib/modules:/lib/modules
ports:
- "51820:51820/udp"
dns:
- 10.2.0.100 # Points to pihole
- 10.2.0.200 # Points to unbound
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped
networks:
private_network:
ipv4_address: 10.2.0.3
pihole:
depends_on: [unbound]
container_name: pihole
image: pihole/pihole:latest
restart: unless-stopped
hostname: pihole
dns:
- 127.0.0.1
- 10.2.0.200 # Points to unbound
environment:
TZ: "America/Chicago"
WEBPASSWORD: "aPassword" # Blank password - Can be whatever you want.
ServerIP: 10.2.0.100 # Internal IP of pihole
DNS1: 10.2.0.200 # Unbound IP
DNS2: 10.2.0.200 # If we don't specify two, it will auto pick google.
# Volumes store your data between container upgrades
volumes:
- "./etc-pihole/:/etc/pihole/"
- "./etc-dnsmasq.d/:/etc/dnsmasq.d/"
# Recommended but not required (DHCP needs NET_ADMIN)
# https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
cap_add:
- NET_ADMIN
networks:
private_network:
ipv4_address: 10.2.0.100