-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
45 lines (44 loc) · 1.48 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
version: '2.1'
services:
openvpn-server:
build:
dockerfile: Dockerfile
context: .
environment:
- OPENVPN_CONFIG_FILE=/etc/openvpn/server.conf
- NAT_MASQUERADE=1
# - CUSTOM_FIREWALL_SCRIPT=/etc/openvpn/firewall.sh
volumes:
- ./openvpn/server.conf:/etc/openvpn/server.conf
# - ./openvpn/firewall.sh:/etc/openvpn/firewall.sh
ports:
- 1194:1194/udp
cap_add:
- NET_ADMIN
# sysctls for the container if it is not set on the host. See: https://docs.docker.com/compose/compose-file/compose-file-v2/#sysctls
sysctls:
- net.ipv4.conf.all.forwarding=1
# - net.ipv6.conf.all.disable_ipv6=0
# - net.ipv6.conf.default.forwarding=1
# - net.ipv6.conf.all.forwarding=1
restart: unless-stopped
openvpn-client:
build:
dockerfile: Dockerfile
context: .
environment:
- OPENVPN_CONFIG_FILE=/etc/openvpn/client.conf
- NAT_MASQUERADE=0
# - CUSTOM_FIREWALL_SCRIPT=/etc/openvpn/firewall.sh
volumes:
- ./openvpn/client.conf:/etc/openvpn/client.conf
# - ./openvpn/firewall.sh:/etc/openvpn/firewall.sh
cap_add:
- NET_ADMIN
# sysctls for the container if it is not set on the host. See: https://docs.docker.com/compose/compose-file/compose-file-v2/#sysctls
sysctls:
- net.ipv4.conf.all.forwarding=1
# - net.ipv6.conf.all.disable_ipv6=0
# - net.ipv6.conf.default.forwarding=1
# - net.ipv6.conf.all.forwarding=1
restart: unless-stopped