version: "2.1"
services:
  openvpn:
    cap_add:
     - NET_ADMIN
    image: kylemanna/openvpn:2.4
    container_name: ${CONTAINER_NAME} 
    ports:
     - "1194:1194/udp"
     - "8050:8080"
     - "8989:8989"
    restart: "no" 
    volumes:
     - ${DATA_ROOT}/conf:/etc/openvpn
     - ${DATA_ROOT}/ccd_master:/etc/openvpn/ccd
    
  ovpn-admin:
    image: flant/ovpn-admin:1.7.5 
    container_name: ${CONTAINER_NAME}-admin
    command: /app/ovpn-admin
    environment:
      OVPN_DEBUG: "True"
      OVPN_VERBOSE: "True"
      OVPN_NETWORK: "192.168.255.0/24"
      EASYRSA_PATH: "/mnt/easyrsa"
      OVPN_SERVER: "127.0.0.1:1194:tcp"
      OVPN_INDEX_PATH: "/mnt/easyrsa/pki/index.txt"
    network_mode: service:openvpn
    volumes:
      - ${DATA_ROOT}/conf:/mnt/easyrsa
      - ${DATA_ROOT}/ccd_master:/mnt/ccd


    
