#!/bin/bash # Script to pull Supabase Docker images one at a time to avoid rate limits set -e echo "=== Pulling Supabase Images ===" echo "" echo "This script pulls images one at a time with delays to avoid Docker Hub rate limits." echo "" cd "$(dirname "$0")/.." # List of Supabase services to pull SERVICES=( "supabase-db" "supabase-rest" "supabase-auth" "supabase-realtime" "supabase-storage" "supabase-studio" "supabase-meta" "supabase-migrate" "supabase-inbucket" ) # Delay between pulls (in seconds) DELAY=10 SUCCESS=0 FAILED=0 for service in "${SERVICES[@]}"; do echo "Pulling image for: $service" if docker compose pull "$service" 2>&1 | grep -q "Error\|rate\|toomanyrequests"; then echo " ⚠ Rate limit hit or error. Waiting ${DELAY} seconds..." sleep $DELAY # Try once more if ! docker compose pull "$service" 2>&1 | tail -1 | grep -q "Error\|rate\|toomanyrequests"; then echo " ✓ Successfully pulled $service" ((SUCCESS++)) else echo " ✗ Failed to pull $service (rate limited)" ((FAILED++)) echo " → You may need to wait longer or login to Docker Hub: docker login" fi else echo " ✓ Successfully pulled $service" ((SUCCESS++)) fi # Small delay between pulls if [ $SUCCESS -lt ${#SERVICES[@]} ]; then echo " Waiting ${DELAY} seconds before next pull..." sleep $DELAY fi echo "" done echo "=== Summary ===" echo "Successfully pulled: $SUCCESS" echo "Failed: $FAILED" echo "" if [ $FAILED -eq 0 ]; then echo "✓ All images pulled successfully!" echo "" echo "You can now start the services:" echo " docker compose up -d supabase-*" else echo "⚠ Some images failed to pull due to rate limits." echo "" echo "Solutions:" echo " 1. Wait a few minutes and run this script again" echo " 2. Login to Docker Hub: docker login" echo " 3. Pull images manually one at a time with delays" fi