name: wireguard
services:
  upnp:
    image: ghcr.io/vleeuwenmenno/auto-upnp:latest
    restart: unless-stopped
    network_mode: host
    environment:
      UPNP_DURATION: 86400  # 24 hours in seconds
      PORTS: |
        [
          {"port": 51820, "protocol": "udp"}
        ]

  server:
    image: lscr.io/linuxserver/wireguard:latest
    container_name: wireguard
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - PEERS=s24,pc,laptop
    volumes:
      - /mnt/services/wireguard/data:/config
    ports:
      - 51820:51820/udp
    sysctls:
      - net.ipv4.conf.all.src_valid_mark=1
    restart: unless-stopped
