fix: prevent duplicate network creation in deploy-dev
Use docker network inspect to check if network exists before creating.
This commit is contained in:
@@ -66,11 +66,13 @@ jobs:
|
|||||||
# Clean up any legacy manual containers
|
# Clean up any legacy manual containers
|
||||||
docker rm -f nas-dashboard-dev 2>/dev/null || true
|
docker rm -f nas-dashboard-dev 2>/dev/null || true
|
||||||
|
|
||||||
# Ensure network exists
|
# Ensure network exists (create only if it doesn't exist)
|
||||||
docker network create nas-dashboard_internal 2>/dev/null || true
|
if ! docker network inspect nas-dashboard_internal >/dev/null 2>&1; then
|
||||||
|
docker network create nas-dashboard_internal
|
||||||
|
fi
|
||||||
|
|
||||||
# Use a dedicated project name to avoid killing production (which is project 'nas-dashboard')
|
# Use a dedicated project name to avoid killing production (which is project 'nas-dashboard')
|
||||||
# and deploy using theSynced compose file.
|
# and deploy using the synced compose file.
|
||||||
docker compose -f docker-compose.dev.yml -p nas-dashboard-dev down --remove-orphans || true
|
docker compose -f docker-compose.dev.yml -p nas-dashboard-dev down --remove-orphans || true
|
||||||
docker compose -f docker-compose.dev.yml -p nas-dashboard-dev up -d --build --pull never
|
docker compose -f docker-compose.dev.yml -p nas-dashboard-dev up -d --build --pull never
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user