fix(services): conditional caddy_net across all Docker service scripts
Only include the caddy_net network block in generated docker-compose.yml files when ~/docker/caddy exists. Prevents "network caddy_net declared as external, but could not be found" on standalone installs without Caddy. Affected: actualbudget, archivebox, arm, audiobookshelf, calibre-web, changedetection, drum-rhythm-game, emby, fmd, frigate, frigate-audio, frigate-notify, gatus, homeassistant, immich, iopaint, jellyfin, joplin, koha, lyrion, magicmirror, mail-archiver, mattermost, mealie, meshcentral, n8n, nextcloud, ntfy, onlyoffice, portainer, stirling-pdf, syncthing, traccar, unifi, uptimekuma, vaultwarden, wg-easy Skipped: authelia (creates caddy_net itself), caddy, crowdsec, wolf, wolf-pair, and services using network_mode: host with no caddy_net. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01D8ckUJQtj1pH8jtAddBDZs
This commit is contained in:
+21
-12
@@ -197,7 +197,24 @@ install_changedetection() {
|
||||
ensure_docker_dir_ownership "$CD_DIR"
|
||||
cd "$CD_DIR" || return 1
|
||||
|
||||
cat > docker-compose.yml << 'CD_COMPOSE'
|
||||
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 << CD_COMPOSE
|
||||
name: changedetection
|
||||
|
||||
services:
|
||||
@@ -209,13 +226,11 @@ services:
|
||||
ports:
|
||||
- "5000:5000"
|
||||
environment:
|
||||
- BASE_URL=${BASE_URL}
|
||||
- BASE_URL=\${BASE_URL}
|
||||
- PLAYWRIGHT_DRIVER_URL=ws://playwright-chrome:3000
|
||||
volumes:
|
||||
- ./data:/datastore
|
||||
networks:
|
||||
- caddy_net
|
||||
depends_on:
|
||||
${_CADDY_NET_BLOCK} depends_on:
|
||||
- playwright-chrome
|
||||
|
||||
playwright-chrome:
|
||||
@@ -225,13 +240,7 @@ services:
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- DEFAULT_LAUNCH_ARGS=--no-sandbox --disable-dev-shm-usage
|
||||
networks:
|
||||
- caddy_net
|
||||
|
||||
networks:
|
||||
caddy_net:
|
||||
external: true
|
||||
name: ${CADDY_NET:-caddy_net}
|
||||
${_CADDY_NET_BLOCK}${_CADDY_NET_SECTION}
|
||||
CD_COMPOSE
|
||||
|
||||
cat > .env << CD_ENV
|
||||
|
||||
Reference in New Issue
Block a user