Fix Caddy routing and add caddy_net to all Docker services
- lib/common.sh: fix broken reverse_proxy target — localhost inside Caddy's container is the container's own loopback, not the host; change to host.docker.internal so proxied ports are actually reachable - services/caddy.sh: add extra_hosts host.docker.internal:host-gateway so the above resolves correctly; create caddy_net bridge network in Caddy's own compose so other services can reference it as external; update all Caddyfile template comments and README examples to match - services/filebrowser.sh: update image tag from deprecated :s6 to :latest; remove non-functional PUID/PGID env vars (filebrowser/filebrowser does not honour them); add configure_caddy_for_service call; add caddy_net - services/ntfy.sh: add configure_caddy_for_service call; add caddy_net - services/portainer.sh: add configure_caddy_for_service call; add caddy_net - services/frigate-notify.sh, watchtower.sh: add caddy_net for container-to-container comms (frigate, ntfy) without a Caddy call - All remaining web-facing Docker services: add caddy_net network block to docker-compose and CADDY_NET to .env where applicable; services using network_mode: host (wolf-pair, lyrion) have the top-level block only https://claude.ai/code/session_01UZus2Q9gNTfUdqSMrhuX29
This commit is contained in:
+12
-3
@@ -82,6 +82,15 @@ services:
|
||||
- ACME_AGREE=true
|
||||
labels:
|
||||
- "io.podman.annotations.label/crowdsec.enable=true"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
networks:
|
||||
- caddy_net
|
||||
|
||||
networks:
|
||||
caddy_net:
|
||||
driver: bridge
|
||||
name: caddy_net
|
||||
CADDY_COMPOSE
|
||||
|
||||
# Create Caddyfile if it doesn't exist
|
||||
@@ -114,7 +123,7 @@ CADDY_COMPOSE
|
||||
# Example:
|
||||
# myservice.yourdomain.com {
|
||||
# import authelia
|
||||
# reverse_proxy localhost:PORT
|
||||
# reverse_proxy host.docker.internal:PORT
|
||||
# }
|
||||
|
||||
# ActualBudget
|
||||
@@ -124,7 +133,7 @@ CADDY_COMPOSE
|
||||
# format json
|
||||
# level INFO
|
||||
# }
|
||||
# reverse_proxy localhost:5006
|
||||
# reverse_proxy host.docker.internal:5006
|
||||
# header {
|
||||
# Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
|
||||
# X-Frame-Options "SAMEORIGIN"
|
||||
@@ -165,7 +174,7 @@ a web service). You can also edit it by hand:
|
||||
|
||||
```
|
||||
myservice.example.com {
|
||||
reverse_proxy localhost:1234
|
||||
reverse_proxy host.docker.internal:1234
|
||||
log {
|
||||
output file /var/log/caddy/myservice.example.com.log
|
||||
format json
|
||||
|
||||
Reference in New Issue
Block a user