version: "2.1"
services:
  openvpn-as:
    image: openvpn/openvpn-as
    container_name: openvpn-as
    devices:
      - /dev/net/tun:/dev/net/tun
    cap_add:
      - NET_ADMIN
      - MKNOD
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Shanghai
      - INTERFACE=eth0 #optional
    volumes:
      - /opt/docker-data/openvpn/config:/openvpn
    ports:
      #- 127.0.0.1:943:943   #客户端UI访问
      - 943:943   #客户端UI访问
      - 9443:443   #Port for VNP Client tcp
      - 1194:1194/udp  #Port for VNP Client udp
    restart: unless-stopped

  #修改admin账户Modify the as.conf file under config/etc and replace the line boot_pam_users.0=admin with #boot_pam_users.0=admin boot_pam_users.0=kjhvkhv (this only has to be done once and will survive container recreation)