run caddy in wireguard network namespace to access VPN routes

This commit is contained in:
Eduardo Silva
2026-03-16 14:51:36 -03:00
parent 5cadfba3b7
commit 4c57f43f4b

View File

@@ -28,6 +28,9 @@ services:
ports: ports:
# Do not directly expose the Django port to the internet, use some kind of reverse proxy with SSL. # Do not directly expose the Django port to the internet, use some kind of reverse proxy with SSL.
- "8000:8000" - "8000:8000"
# Caddy ports — declared here because wireguard-webadmin-caddy shares this network namespace
- "80:80"
- "443:443"
# Warning: Docker will have a hard time handling large amount of ports. Expose only the ports that you need. # Warning: Docker will have a hard time handling large amount of ports. Expose only the ports that you need.
# Ports for multiple WireGuard instances. (Probably, you just need one) # Ports for multiple WireGuard instances. (Probably, you just need one)
- "51820-51839:51820-51839/udp" - "51820-51839:51820-51839/udp"
@@ -96,9 +99,7 @@ services:
- caddy_json_export:/caddy_json_export - caddy_json_export:/caddy_json_export
- caddy_data:/data - caddy_data:/data
- caddy_config:/config - caddy_config:/config
ports: network_mode: "service:wireguard-webadmin"
- "80:80"
- "443:443"
depends_on: depends_on:
- wireguard-webadmin - wireguard-webadmin
- wireguard-webadmin-auth-gateway - wireguard-webadmin-auth-gateway