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:
Claude
2026-06-07 22:02:26 +00:00
parent a5a61da714
commit 56bec03c9b
26 changed files with 210 additions and 8 deletions
+11 -3
View File
@@ -26,13 +26,11 @@ name: filebrowser
services:
filebrowser:
image: filebrowser/filebrowser:s6
image: filebrowser/filebrowser:latest
container_name: filebrowser
hostname: filebrowser
restart: unless-stopped
environment:
- PUID=$(id -u "$ACTUAL_USER")
- PGID=$(id -g "$ACTUAL_USER")
- TZ=${SITE_TZ:-$(cat /etc/timezone 2>/dev/null || echo UTC)}
volumes:
- ${FB_PATH}:/srv
@@ -40,10 +38,18 @@ services:
- ./config/settings.json:/config/settings.json
ports:
- "8085:80"
networks:
- caddy_net
networks:
caddy_net:
external: true
name: \${CADDY_NET:-caddy_net}
FB_COMPOSE
cat > .env << FB_ENV
FB_PATH=$FB_PATH
CADDY_NET=$SITE_CADDY_NET
FB_ENV
mkdir -p database config
@@ -64,6 +70,8 @@ FB_SETTINGS
echo ""
log_success "Filebrowser configured at $FB_DIR"
configure_caddy_for_service "FileBrowser" "8085" "files"
write_readme "$FB_DIR" << MD
# FileBrowser