version: "3.8"
services:
  wg-easy:
    environment:
      # ⚠️ Required:
      # Change this to your host's public address
      - WG_HOST=${WG_HOST}

      # Optional:
      - PASSWORD=${PASSWORD}
      - WG_PORT=${WG_PORT}
      - WG_DEFAULT_ADDRESS=${WG_DEFAULT_ADDRESS}
      - WG_DEFAULT_DNS=${WG_DEFAULT_DNS}
      - WG_ALLOWED_IPS=${WG_ALLOWED_IPS}
      
    image: ghcr.io/wg-easy/wg-easy:latest
    container_name: wg-easy
    volumes:
      - /portainer/Files/AppData/Config/wireguard:/etc/wireguard
    ports:
      - "${WG_PORT}:51820/udp"
      - "51821:51821/tcp"
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
      - SYS_MODULE
    sysctls:
      - net.ipv4.ip_forward=1
      - net.ipv4.conf.all.src_valid_mark=1
