forked from IAmStoxe/wirehole
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
80 lines (75 loc) · 2.67 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
version: "3"
networks:
private_network:
ipam:
driver: default
config:
- subnet: 10.2.0.0/24
services:
unbound:
image: "mvance/unbound:1.16.3"
container_name: unbound
restart: unless-stopped
hostname: "unbound"
volumes:
- "./unbound:/opt/unbound/etc/unbound/"
networks:
private_network:
ipv4_address: 10.2.0.200
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: "Europe/Moscow"
WEBPASSWORD: "CHANGE_ME93a3027594175ca45f1043092936d32f652fafcb" # 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
# Based on https://github.com/IAmStoxe/wirehole/issues/43#issuecomment-951991774
wg-easy:
depends_on: [unbound, pihole]
image: weejewel/wg-easy:latest
container_name: wg-easy
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
- WG_HOST=${IP:?IP=$$(hostname -I | cut -d' ' -f1) docker compose up -d --build}
- PASSWORD=CHANGE_ME93a3027594175ca45f1043092936d32f652fafcb
- WG_DEFAULT_DNS=10.2.0.100
- WG_ALLOWED_IPS=0.0.0.0/0, ::/0
# - WG_ALLOWED_IPS= 0.0.0.0/1, 10.8.0.0/24, 10.8.1.0/24, 128.0.0.0/2, 192.0.0.0/9, 192.128.0.0/11, 192.160.0.0/13, 192.168.1.0/24, 192.168.2.0/23, 192.168.4.0/22, 192.168.8.0/21, 192.168.16.0/20, 192.168.32.0/19, 192.168.64.0/18, 192.168.128.0/17, 192.169.0.0/16, 192.170.0.0/15, 192.172.0.0/14, 192.176.0.0/12, 192.192.0.0/10, 193.0.0.0/8, 194.0.0.0/7, 196.0.0.0/6, 200.0.0.0/5, 208.0.0.0/4, 224.0.0.0/3
# figure out what you want to allow and what to block
# https://www.procustodibus.com/blog/2021/03/wireguard-allowedips-calculator/
volumes:
- ./wireguard:/etc/wireguard
ports:
- "51820:51820/udp"
- "51821:51821" # Comment this line after first launch
dns:
- 10.2.0.100 # Points to pihole
- 10.2.0.200 # Points to unbound
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
- net.ipv4.ip_forward=1
restart: unless-stopped
networks:
private_network:
ipv4_address: 10.2.0.3