version: "2.1"
services:
  wireguard:
    image: lscr.io/linuxserver/wireguard
    container_name: wireguard
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Asia/Hong_Kong
      - PEERDNS=auto
      - PEERS=1
      - INTERNAL_SUBNET=10.13.13.0
      - SERVERURL=vpn.algometic.com #optional
      - ALLOWEDIPS=10.13.13.0/24 #optional
    volumes:
      - ./data/config:/config
      - ./data/lib/modules:/lib/modules
    ports:
      - 51820:51820/udp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
      - net.ipv4.ip_forward=1
    restart: "no" 


  wireguard-ui:
    image: embarkstudios/wireguard-ui:latest
    entrypoint: "/wireguard-ui"
    privileged: true
    network_mode: host
    volumes:
      - ./data/wireguard-ui:/data
    environment:
      - WIREGUARD_UI_LISTEN_ADDRESS=0.0.0.0:8044
      - WIREGUARD_UI_LOG_LEVEL=debug
      - WIREGUARD_UI_DATA_DIR=/data
      - WIREGUARD_UI_WG_ENDPOINT=vpn.algometic.com:51820
      - WIREGUARD_UI_CLIENT_IP_RANGE=10.13.13.16/28
      - WIREGUARD_UI_NAT=true
      - WIREGUARD_UI_NAT_DEVICE=enp6s0.1
      - WIREGUARD_UI_WG_DEVICE=wg0

