fix(services): conditional caddy_net for filebrowser, homebox, watchtower

Only include the caddy_net network block in docker-compose.yml when
~/docker/caddy exists, preventing "network not found" errors on
standalone installs without Caddy.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs
This commit is contained in:
Claude
2026-06-20 04:06:51 +00:00
parent 07d09a73fe
commit 68a4effad5
3 changed files with 54 additions and 21 deletions
+18 -7
View File
@@ -128,6 +128,23 @@ install_watchtower() {
NTFY_URL="http://ntfy/watchtower"
fi
local _CADDY_NET_BLOCK=""
if [ -d "$DOCKER_DIR/caddy" ]; then
_CADDY_NET_BLOCK=" networks:
- caddy_net
"
fi
local _CADDY_NET_SECTION=""
if [ -d "$DOCKER_DIR/caddy" ]; then
_CADDY_NET_SECTION="
networks:
caddy_net:
external: true
name: ${SITE_CADDY_NET:-caddy_net}
"
fi
cat > docker-compose.yml << WT_COMPOSE
name: watchtower
@@ -152,13 +169,7 @@ services:
- WATCHTOWER_DEBUG=false
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
- caddy_net
networks:
caddy_net:
external: true
name: \${CADDY_NET:-caddy_net}
${_CADDY_NET_BLOCK}${_CADDY_NET_SECTION}
WT_COMPOSE
# Create .env