Fix CI/CD: Force cleanup orphan containers before deployment

This commit is contained in:
SysAdmin 2025-09-28 19:00:09 +01:00
parent 1b46222300
commit 7ffb3de3f2

View File

@ -60,9 +60,14 @@ deploy:vps:
# Navigate to deployment directory # Navigate to deployment directory
cd /opt/littleshop cd /opt/littleshop
# Stop services # Force stop all littleshop containers (including orphans)
echo "Stopping services..." echo "Stopping all littleshop containers..."
docker-compose down docker stop \$(docker ps -q --filter "name=littleshop") 2>/dev/null || true
docker rm \$(docker ps -aq --filter "name=littleshop") 2>/dev/null || true
# Stop services with compose (removes networks)
echo "Stopping compose services..."
docker-compose down --remove-orphans || true
# Start services with new image # Start services with new image
echo "Starting services with new image..." echo "Starting services with new image..."