diff --git a/scripts/local_rebuild.sh b/scripts/local_rebuild.sh index fdd4a04..8ceaf30 100755 --- a/scripts/local_rebuild.sh +++ b/scripts/local_rebuild.sh @@ -52,17 +52,19 @@ fi if [ "$FAST_DEPLOY" = true ]; then - echo "⚡ Fast Deployment: Skipping 'down' and '--build', but forcing container recreation to reload code..." - sudo $DOCKER_CMD $COMPOSE_FILES up -d --force-recreate > /tmp/deploy_log.txt 2>&1 + echo "⚡ Fast Deployment: restarting all services without rebuilding images..." + # Stop cleanly first to avoid container-name conflicts and orphaned networks, + # then start without --build so images are reused but code (bind-mounted) is fresh. + sudo $DOCKER_CMD $COMPOSE_FILES down --remove-orphans 2>&1 || true + sudo $DOCKER_CMD $COMPOSE_FILES up -d --no-build 2>&1 | tee /tmp/deploy_log.txt else echo "🛑 Stopping and removing old Docker containers and networks..." sudo $DOCKER_CMD $COMPOSE_FILES down --remove-orphans || true echo "🏗️ Building and starting new containers..." - sudo $DOCKER_CMD $COMPOSE_FILES up -d --build > /tmp/deploy_log.txt 2>&1 + sudo $DOCKER_CMD $COMPOSE_FILES up -d --build 2>&1 | tee /tmp/deploy_log.txt fi echo "✅ Containers started! Checking status..." -cat /tmp/deploy_log.txt sudo docker ps --filter "name=ai_" sudo docker ps --filter "name=cortex-"