diff --git a/sync-to-server.sh b/sync-to-server.sh index ca66271..27b26c7 100755 --- a/sync-to-server.sh +++ b/sync-to-server.sh @@ -57,7 +57,10 @@ ssh $SERVER_USER@$SERVER_IP << EOF fi if [ -f "docker-compose.yml" ]; then - echo "๐Ÿ—๏ธ Rebuilding production containers using \$DOCKER_CMD..." + echo "๐Ÿงน Cleaning up old containers and orphans..." + \$DOCKER_CMD down --remove-orphans || true + + echo "๐Ÿ—๏ธ Rebuilding and starting production containers using \$DOCKER_CMD..." \$DOCKER_CMD up -d --build else echo "โŒ Error: docker-compose.yml not found!"