ovpn-admin/docker-compose.yaml

65 lines
1.6 KiB
YAML
Raw Normal View History

2020-10-15 19:12:31 +03:00
version: '3'
networks:
vpn-internal:
driver: bridge
ipam:
config:
- subnet: 172.18.0.0/16
2020-10-15 19:12:31 +03:00
services:
openvpn:
2020-10-29 13:50:19 +03:00
build:
context: .
dockerfile: Dockerfile.openvpn
2020-10-15 19:12:31 +03:00
image: openvpn:local
command: /etc/openvpn/setup/configure.sh
environment:
OVPN_SERVER_NET: "10.8.0.0"
OVPN_SERVER_MASK: "255.255.255.0"
OVPN_PASSWD_AUTH: "true"
OVPN_CUSTOM_ROUTES: "172.18.0.0 255.255.0.0"
2020-10-29 13:50:19 +03:00
cap_add:
- NET_ADMIN
sysctls:
- net.ipv4.ip_forward=1
2020-10-15 19:12:31 +03:00
ports:
- 7777:1194/udp # Changed to UDP for better performance
2021-03-17 16:05:37 +07:00
- 8080:8080 # for ovpn-admin because of network_mode
2020-10-15 19:12:31 +03:00
volumes:
- ./easyrsa_master:/etc/openvpn/easyrsa
- ./ccd_master:/etc/openvpn/ccd
networks:
- vpn-internal
2021-03-17 16:05:37 +07:00
ovpn-admin:
2020-10-15 19:12:31 +03:00
build:
context: .
dockerfile: Dockerfile.ovpn-admin
2021-03-17 16:05:37 +07:00
image: ovpn-admin:local
command: /app/ovpn-admin
environment:
OVPN_DEBUG: "true"
OVPN_VERBOSE: "true"
OVPN_NETWORK: "10.8.0.0/24"
OVPN_CCD: "true"
OVPN_CCD_PATH: "/mnt/ccd"
EASYRSA_PATH: "/mnt/easyrsa"
OVPN_SERVER: "13.127.115.63:7777:udp" # Changed to UDP
OVPN_INDEX_PATH: "/mnt/easyrsa/pki/index.txt"
OVPN_AUTH: "true"
OVPN_CIPHER: "AES-256-GCM"
OVPN_AUTH_DB_PATH: "/mnt/easyrsa/pki/users.db"
LOG_LEVEL: "debug"
network_mode: service:openvpn
2020-10-15 19:12:31 +03:00
volumes:
- ./easyrsa_master:/mnt/easyrsa
- ./ccd_master:/mnt/ccd
nginx:
image: nginx:alpine
container_name: vpn-nginx
networks:
vpn-internal:
ipv4_address: 172.18.0.10
restart: unless-stopped