gistfile1.txt
· 1.8 KiB · Text
Raw
version: "3"
services:
wireguard:
image: lscr.io/linuxserver/wireguard:latest
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
- PUID=1026
- PGID=100
- TZ=Europe/Bratislava
volumes:
- /volume1/docker/wireguard:/config
ports:
- "5000:5000"
- "51820:51820/udp"
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: always
wireguard-ui:
image: ngoduykhanh/wireguard-ui:latest
container_name: wireguard-ui
depends_on:
- wireguard
cap_add:
- NET_ADMIN
network_mode: service:wireguard
environment:
- TZ=Europe/Bratislava
- EMAIL_FROM_ADDRESS=YOUR@EMAIL.COM
- EMAIL_FROM_NAME=WireGuard
- SMTP_PORT=587
- SMTP_USERNAME=YOUR@EMAIL.COM
- SMTP_PASSWORD=EMAIL_PASSWORD
- SMTP_ENCRYPTION=STARTTLS
- SMTP_HOSTNAME=smtp.mail.com
- SMTP_AUTH_TYPE=LOGIN
- SESSION_SECRET=ANY_LONG_STRING
- WGUI_USERNAME=admin
- WGUI_PASSWORD=admin
- WGUI_MANAGE_START=true
- WGUI_MANAGE_RESTART=true
- 'WGUI_SERVER_POST_UP_SCRIPT=iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE'
- 'WGUI_SERVER_POST_DOWN_SCRIPT=iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE'
- WGUI_SERVER_LISTEN_PORT=51820
- 'WGUI_DEFAULT_CLIENT_ALLOWED_IPS=0.0.0.0/0,::/0'
- WGUI_ENDPOINT_ADDRESS=IP or DNS name
- WGUI_MTU=none
- WGUI_PERSISTENT_KEEPALIVE=none
- WGUI_SERVER_INTERFACE_ADDRESSES=10.0.110.0/24
- WGUI_DNS=1.1.1.1
- WGUI_LOG_LEVEL=INFO
logging:
driver: json-file
options:
max-size: 50m
volumes:
- /volume1/docker/wireguard/ui:/app/db
- /volume1/docker/wireguard:/etc/wireguard
restart: always
1 | version: "3" |
2 | |
3 | services: |
4 | wireguard: |
5 | image: lscr.io/linuxserver/wireguard:latest |
6 | container_name: wireguard |
7 | cap_add: |
8 | - NET_ADMIN |
9 | - SYS_MODULE |
10 | environment: |
11 | - PUID=1026 |
12 | - PGID=100 |
13 | - TZ=Europe/Bratislava |
14 | volumes: |
15 | - /volume1/docker/wireguard:/config |
16 | ports: |
17 | - "5000:5000" |
18 | - "51820:51820/udp" |
19 | sysctls: |
20 | - net.ipv4.conf.all.src_valid_mark=1 |
21 | restart: always |
22 | |
23 | wireguard-ui: |
24 | image: ngoduykhanh/wireguard-ui:latest |
25 | container_name: wireguard-ui |
26 | depends_on: |
27 | - wireguard |
28 | cap_add: |
29 | - NET_ADMIN |
30 | network_mode: service:wireguard |
31 | environment: |
32 | - TZ=Europe/Bratislava |
33 | - EMAIL_FROM_ADDRESS=YOUR@EMAIL.COM |
34 | - EMAIL_FROM_NAME=WireGuard |
35 | - SMTP_PORT=587 |
36 | - SMTP_USERNAME=YOUR@EMAIL.COM |
37 | - SMTP_PASSWORD=EMAIL_PASSWORD |
38 | - SMTP_ENCRYPTION=STARTTLS |
39 | - SMTP_HOSTNAME=smtp.mail.com |
40 | - SMTP_AUTH_TYPE=LOGIN |
41 | - SESSION_SECRET=ANY_LONG_STRING |
42 | - WGUI_USERNAME=admin |
43 | - WGUI_PASSWORD=admin |
44 | - WGUI_MANAGE_START=true |
45 | - WGUI_MANAGE_RESTART=true |
46 | - 'WGUI_SERVER_POST_UP_SCRIPT=iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE' |
47 | - 'WGUI_SERVER_POST_DOWN_SCRIPT=iptables -D FORWARD -i wg0 -j ACCEPT; iptables -t nat -D POSTROUTING -o eth0 -j MASQUERADE' |
48 | - WGUI_SERVER_LISTEN_PORT=51820 |
49 | - 'WGUI_DEFAULT_CLIENT_ALLOWED_IPS=0.0.0.0/0,::/0' |
50 | - WGUI_ENDPOINT_ADDRESS=IP or DNS name |
51 | - WGUI_MTU=none |
52 | - WGUI_PERSISTENT_KEEPALIVE=none |
53 | - WGUI_SERVER_INTERFACE_ADDRESSES=10.0.110.0/24 |
54 | - WGUI_DNS=1.1.1.1 |
55 | - WGUI_LOG_LEVEL=INFO |
56 | logging: |
57 | driver: json-file |
58 | options: |
59 | max-size: 50m |
60 | volumes: |
61 | - /volume1/docker/wireguard/ui:/app/db |
62 | - /volume1/docker/wireguard:/etc/wireguard |
63 | restart: always |