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:
+25
-20
@@ -268,8 +268,25 @@ install_iopaint() {
|
||||
# Volume ./models:/root/.cache persists ALL model caches:
|
||||
# /root/.cache/torch/hub/checkpoints/ (LaMa, CV2, ZITS, etc.)
|
||||
# /root/.cache/huggingface/ (SD, PowerPaint, LDM, etc.)
|
||||
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
|
||||
|
||||
if [[ "$USE_GPU" =~ ^[Yy]$ ]]; then
|
||||
cat > docker-compose.yml << 'IOPAINT_GPU'
|
||||
cat > docker-compose.yml << IOPAINT_GPU
|
||||
name: iopaint
|
||||
|
||||
services:
|
||||
@@ -280,8 +297,8 @@ services:
|
||||
restart: unless-stopped
|
||||
command: >-
|
||||
iopaint start
|
||||
--model=${MODEL:-lama}
|
||||
--device=${DEVICE:-cuda}
|
||||
--model=\${MODEL:-lama}
|
||||
--device=\${DEVICE:-cuda}
|
||||
--port=8080
|
||||
--host=0.0.0.0
|
||||
ports:
|
||||
@@ -298,16 +315,10 @@ services:
|
||||
- driver: nvidia
|
||||
count: 1
|
||||
capabilities: [gpu]
|
||||
networks:
|
||||
- caddy_net
|
||||
|
||||
networks:
|
||||
caddy_net:
|
||||
external: true
|
||||
name: ${CADDY_NET:-caddy_net}
|
||||
${_CADDY_NET_BLOCK}${_CADDY_NET_SECTION}
|
||||
IOPAINT_GPU
|
||||
else
|
||||
cat > docker-compose.yml << 'IOPAINT_CPU'
|
||||
cat > docker-compose.yml << IOPAINT_CPU
|
||||
name: iopaint
|
||||
|
||||
services:
|
||||
@@ -318,8 +329,8 @@ services:
|
||||
restart: unless-stopped
|
||||
command: >-
|
||||
iopaint start
|
||||
--model=${MODEL:-lama}
|
||||
--device=${DEVICE:-cpu}
|
||||
--model=\${MODEL:-lama}
|
||||
--device=\${DEVICE:-cpu}
|
||||
--port=8080
|
||||
--host=0.0.0.0
|
||||
ports:
|
||||
@@ -329,13 +340,7 @@ services:
|
||||
- ./models:/root/.cache
|
||||
- ./input:/app/input
|
||||
- ./output:/app/output
|
||||
networks:
|
||||
- caddy_net
|
||||
|
||||
networks:
|
||||
caddy_net:
|
||||
external: true
|
||||
name: ${CADDY_NET:-caddy_net}
|
||||
${_CADDY_NET_BLOCK}${_CADDY_NET_SECTION}
|
||||
IOPAINT_CPU
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user