Created tunnel network to keep cf tunnel isolated from homelab network

This commit is contained in:
2025-12-12 10:01:26 -05:00
parent 8f925b29c3
commit 9a06c52f27
2 changed files with 10 additions and 0 deletions

View File

@@ -2,9 +2,16 @@ services:
cloudflared: cloudflared:
image: cloudflare/cloudflared:latest image: cloudflare/cloudflared:latest
restart: unless-stopped restart: unless-stopped
networks:
- 'default'
- 'tunnel'
volumes: volumes:
- ./config.yml:/etc/cloudflared/config.yml - ./config.yml:/etc/cloudflared/config.yml
- ./${TUNNEL_ID}.json:/etc/cloudflared/${TUNNEL_ID}.json # Use environment variable for tunnel ID - ./${TUNNEL_ID}.json:/etc/cloudflared/${TUNNEL_ID}.json # Use environment variable for tunnel ID
command: tunnel --no-autoupdate --config /etc/cloudflared/config.yml run command: tunnel --no-autoupdate --config /etc/cloudflared/config.yml run
env_file: env_file:
- .env # Reference the .env file to inject environment variables - .env # Reference the .env file to inject environment variables
networks:
tunnel:
external: true

View File

@@ -8,6 +8,7 @@ services:
# - '443:443' # - '443:443'
networks: networks:
- 'homelab' - 'homelab'
- 'tunnel'
volumes: volumes:
- ./data:/data - ./data:/data
- ./letsencrypt:/etc/letsencrypt - ./letsencrypt:/etc/letsencrypt
@@ -15,3 +16,5 @@ services:
networks: networks:
homelab: homelab:
external: true external: true
tunnel:
external: true