Skip to content

Instantly share code, notes, and snippets.

@coldfire7
Last active January 22, 2023 10:16
Show Gist options
  • Save coldfire7/4155578e3f3227b8c74a69b4594e9462 to your computer and use it in GitHub Desktop.
Save coldfire7/4155578e3f3227b8c74a69b4594e9462 to your computer and use it in GitHub Desktop.
WireGuard Server
version: "3"
services:
wireguard:
image: weejewel/wg-easy:latest
container_name: wireguard
hostname: wireguard
restart: unless-stopped
volumes:
- "/docker/wireguard:/etc/wireguard" # container config location
environment:
- "TZ=Asia/Singapore" # timezone
- "PUID=1000" # puid
- "PGID=1000" # pgid
- "WG_HOST=subdomain.domain.tld" # domain or ip
- "WG_MTU=1420"
- "WG_DEFAULT_ADDRESS=10.69.69.x"
- "WG_DEFAULT_DNS=10.6.9.69" # dns server
- "WG_ALLOWED_IPS=0.0.0.0/0"
- "PASSWORD=ChangeMe12345" # ui password
- "WG_PORT=54321" # wg port
ports:
- "54321:51820/udp" # wg port
- "12345:51821/tcp" # ui port
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
- net.ipv4.ip_forward=1
cap_add:
- NET_ADMIN
- SYS_MODULE
labels:
- "com.centurylinklabs.watchtower.enable=true"
watchtower:
image: containrrr/watchtower:latest
container_name: watchtower
hostname: watchtower
restart: unless-stopped
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
environment:
- "TZ=Asia/Singapore"
- "WATCHTOWER_CLEANUP=true"
- "WATCHTOWER_LABEL_ENABLE=true"
- "WATCHTOWER_INCLUDE_RESTARTING=true"
labels:
- "com.centurylinklabs.watchtower.enable=true"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment