2020-10-15 12:12:31 -04:00
|
|
|
version: '3'
|
|
|
|
|
|
|
|
services:
|
|
|
|
openvpn:
|
2020-10-29 06:50:19 -04:00
|
|
|
build:
|
|
|
|
context: .
|
|
|
|
dockerfile: Dockerfile.openvpn
|
2020-10-15 12:12:31 -04:00
|
|
|
image: openvpn:local
|
|
|
|
command: /etc/openvpn/setup/configure.sh
|
2021-10-21 06:01:03 -04:00
|
|
|
environment:
|
2024-01-01 12:14:00 -05:00
|
|
|
OVPN_SERVER_NET: ${OVPN_SERVER_NET}
|
|
|
|
OVPN_SERVER_MASK: ${OVPN_SERVER_MASK}
|
|
|
|
OVPN_PASSWD_AUTH: "false"
|
2020-10-29 06:50:19 -04:00
|
|
|
cap_add:
|
|
|
|
- NET_ADMIN
|
2020-10-15 12:12:31 -04:00
|
|
|
ports:
|
2024-01-01 12:14:00 -05:00
|
|
|
- ${OVPN_PORT}:1194/${OVPN_PROTOCOL}
|
2020-10-15 12:12:31 -04:00
|
|
|
volumes:
|
2020-11-17 12:48:26 -05:00
|
|
|
- ./easyrsa_master:/etc/openvpn/easyrsa
|
|
|
|
- ./ccd_master:/etc/openvpn/ccd
|
2024-01-01 12:14:00 -05:00
|
|
|
- ./ovpn_config:/etc/openvpn/config
|
|
|
|
networks:
|
|
|
|
ovpn-net:
|
|
|
|
ipv4_address: ${OVPN_SERVER_IP}
|
2021-03-17 05:05:37 -04:00
|
|
|
ovpn-admin:
|
2020-10-15 12:12:31 -04:00
|
|
|
build:
|
|
|
|
context: .
|
2021-03-17 05:05:37 -04:00
|
|
|
image: ovpn-admin:local
|
2021-10-21 06:01:03 -04:00
|
|
|
command: /app/ovpn-admin
|
|
|
|
environment:
|
2022-07-21 11:17:53 -04:00
|
|
|
OVPN_DEBUG: "true"
|
|
|
|
OVPN_VERBOSE: "true"
|
2024-01-01 12:14:00 -05:00
|
|
|
OVPN_NETWORK: ${OVPN_ADMIN_OVPN_NETWORK}
|
2022-07-21 11:17:53 -04:00
|
|
|
OVPN_CCD: "true"
|
|
|
|
OVPN_CCD_PATH: "/mnt/ccd"
|
2021-10-21 06:01:03 -04:00
|
|
|
EASYRSA_PATH: "/mnt/easyrsa"
|
2024-01-01 12:14:00 -05:00
|
|
|
OVPN_SERVER: ${OVPN_PUBLIC_IP}:${OVPN_PORT}:${OVPN_PROTOCOL}
|
2021-10-21 06:01:03 -04:00
|
|
|
OVPN_INDEX_PATH: "/mnt/easyrsa/pki/index.txt"
|
2024-01-01 12:14:00 -05:00
|
|
|
OVPN_AUTH: "false"
|
2022-07-21 11:17:53 -04:00
|
|
|
OVPN_AUTH_DB_PATH: "/mnt/easyrsa/pki/users.db"
|
2024-01-01 12:14:00 -05:00
|
|
|
LOG_LEVEL: "warn"
|
|
|
|
networks:
|
|
|
|
ovpn-net:
|
|
|
|
ipv4_address: ${OVPN_ADMIN_IP}
|
2020-10-15 12:12:31 -04:00
|
|
|
volumes:
|
2020-11-17 12:48:26 -05:00
|
|
|
- ./easyrsa_master:/mnt/easyrsa
|
|
|
|
- ./ccd_master:/mnt/ccd
|
2024-01-01 12:14:00 -05:00
|
|
|
ovpn-nginx:
|
|
|
|
image: nginx:latest
|
|
|
|
container_name: nginx
|
|
|
|
networks:
|
|
|
|
ovpn-net:
|
|
|
|
ipv4_address: ${OVPN_NGINX_IP}
|
|
|
|
ports:
|
|
|
|
- ${OVPN_NGINX_PORT}:8088
|
|
|
|
volumes:
|
|
|
|
- ./nginx/.htpasswd:/etc/nginx/.htpasswd:ro
|
|
|
|
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf:ro
|
|
|
|
networks:
|
|
|
|
ovpn-net:
|
|
|
|
ipam:
|
|
|
|
driver: default
|
|
|
|
config:
|
|
|
|
- subnet: ${OVPN_NET_SUBNET}
|