networking for private vpn access working with wg-easy. Cleaned up clutter
This commit is contained in:
33
compose.yml
33
compose.yml
@@ -41,10 +41,10 @@ services:
|
||||
- ./etc_wireguard:/etc/wireguard
|
||||
environment:
|
||||
- WG_HOST=wg.riverrooks.dev
|
||||
- PASSWORD_HASH=$2a$12$PzmNEYtQws9ylYYtr1yojuGJvWUOzmJTxzVSO0svSb9NvOeg1BUcC
|
||||
# - PASSWORD_HASH=$2a$12$PzmNEYtQws9ylYYtr1yojuGJvWUOzmJTxzVSO0svSb9NvOeg1BUcC
|
||||
- WG_PORT=51820 # WireGuard UDP port
|
||||
- WG_DEFAULT_DNS=1.1.1.1
|
||||
- WG_ALLOWED_IPS=10.8.0.0/24, 172.16.0.0/12
|
||||
- WG_DEFAULT_DNS=10.8.0.1
|
||||
- WG_ALLOWED_IPS=10.8.0.0/24,172.21.0.10
|
||||
|
||||
cap_add:
|
||||
- NET_ADMIN
|
||||
@@ -59,34 +59,41 @@ services:
|
||||
- "51820:51820/udp"
|
||||
networks:
|
||||
traefik: {}
|
||||
frontend: {}
|
||||
|
||||
labels:
|
||||
# since by default containers are disabled, we need to enable them
|
||||
- "traefik.enable=true"
|
||||
# Set a rule for which hostnames will connect
|
||||
- "traefik.http.services.wg-easy-svc.loadbalancer.server.port=51821"
|
||||
|
||||
- "traefik.http.routers.wg-easy.rule=Host(`wg.riverrooks.dev`)"
|
||||
# declare an antrypoint. Websecure is defined in the traefik.yml file
|
||||
- "traefik.http.routers.wg-easy.entrypoints=websecure"
|
||||
# declare the certificate resolver. Also defined in traefik.yml file
|
||||
- "traefik.http.routers.wg-easy.tls.certresolver=basic"
|
||||
# set the port which will be proxied to the address
|
||||
- "traefik.http.services.wg-easy.loadbalancer.server.port=51821"
|
||||
- "traefik.http.routers.wg-easy.middlewares=auth"
|
||||
- "traefik.http.routers.wg-easy.service=wg-easy-svc"
|
||||
|
||||
- "traefik.http.routers.wg-easy-private.rule=Host(`wg.dfnk`)"
|
||||
- "traefik.http.routers.wg-easy-private.entrypoints=websecure"
|
||||
- "traefik.http.routers.wg-easy-private.tls=true"
|
||||
- "traefik.http.routers.wg-easy-private.service=wg-easy-svc"
|
||||
|
||||
dns:
|
||||
image: dockurr/dnsmasq
|
||||
container_name: defenk-dns
|
||||
volumes:
|
||||
- ./dnsmasq.conf:/etc/dnsmasq.conf
|
||||
restart: always
|
||||
network_mode: "service:wg-easy"
|
||||
depends_on:
|
||||
- wg-easy
|
||||
|
||||
networks:
|
||||
# Backend network for docker containers to talk to eachother
|
||||
traefik:
|
||||
name: traefik
|
||||
driver: bridge
|
||||
external: true
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.21.0.0/24
|
||||
# VPN network for external devices to connect to the server
|
||||
frontend:
|
||||
driver: bridge
|
||||
ipam:
|
||||
config:
|
||||
- subnet: 172.20.0.0/24
|
||||
|
||||
Reference in New Issue
Block a user