fix: add network-stripping workaround to production deploy.yml
Bypass Docker 24 network connection bug during compose container creation by stripping network settings and connecting networks manually. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -259,10 +259,33 @@ jobs:
|
|||||||
docker compose -f /nas-dashboard/docker-compose.yml up -d --pull never 2>&1 || true
|
docker compose -f /nas-dashboard/docker-compose.yml up -d --pull never 2>&1 || true
|
||||||
|
|
||||||
if ! docker container inspect nas-dashboard >/dev/null 2>&1; then
|
if ! docker container inspect nas-dashboard >/dev/null 2>&1; then
|
||||||
echo "Compose failed, removing stale containers and retrying..."
|
echo "Compose failed, stripping networks and retrying..."
|
||||||
docker rm -f docker-socket-proxy nas-dashboard 2>/dev/null || true
|
docker rm -f docker-socket-proxy nas-dashboard 2>/dev/null || true
|
||||||
docker network create nas-dashboard_internal 2>/dev/null || true
|
python3 -c "
|
||||||
docker compose -f /nas-dashboard/docker-compose.yml up -d --pull never 2>&1 || true
|
import os
|
||||||
|
lines = open('/nas-dashboard/docker-compose.yml').readlines()
|
||||||
|
out = []
|
||||||
|
skip_net = False
|
||||||
|
for l in lines:
|
||||||
|
stripped = l.strip()
|
||||||
|
if stripped == 'networks:' and not l[0].isspace():
|
||||||
|
skip_net = True
|
||||||
|
continue
|
||||||
|
if skip_net:
|
||||||
|
if l[0].isspace():
|
||||||
|
continue
|
||||||
|
skip_net = False
|
||||||
|
if stripped == 'networks:' and l[:4].strip() == '':
|
||||||
|
skip_net = True
|
||||||
|
continue
|
||||||
|
if skip_net:
|
||||||
|
if l.startswith(' '):
|
||||||
|
continue
|
||||||
|
skip_net = False
|
||||||
|
out.append(l)
|
||||||
|
open('/tmp/prod-ci.yml','w').writelines(out)
|
||||||
|
"
|
||||||
|
docker compose -f /tmp/prod-ci.yml up -d --pull never 2>&1 || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! docker container inspect nas-dashboard >/dev/null 2>&1; then
|
if ! docker container inspect nas-dashboard >/dev/null 2>&1; then
|
||||||
|
|||||||
Reference in New Issue
Block a user