move folder and add supavisor
This commit is contained in:
70
02-supabase/setup.sh
Normal file
70
02-supabase/setup.sh
Normal file
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Supabase Setup Script
|
||||
# This script downloads necessary configuration files and sets up Supabase
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
echo "🚀 Setting up Supabase..."
|
||||
|
||||
# Create necessary directories
|
||||
echo "📁 Creating directories..."
|
||||
mkdir -p volumes/api
|
||||
mkdir -p volumes/db
|
||||
mkdir -p volumes/functions
|
||||
mkdir -p volumes/logs
|
||||
mkdir -p volumes/pooler
|
||||
mkdir -p volumes/storage
|
||||
mkdir -p volumes/snippets
|
||||
|
||||
# Download configuration files from Supabase repository
|
||||
SUPABASE_REPO="https://raw.githubusercontent.com/supabase/supabase/master/docker"
|
||||
|
||||
echo "📥 Downloading configuration files..."
|
||||
|
||||
# Kong API Gateway configuration
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/api/kong.yml" -o volumes/api/kong.yml
|
||||
|
||||
# Database initialization scripts
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/db/realtime.sql" -o volumes/db/realtime.sql
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/db/webhooks.sql" -o volumes/db/webhooks.sql
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/db/roles.sql" -o volumes/db/roles.sql
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/db/jwt.sql" -o volumes/db/jwt.sql
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/db/_supabase.sql" -o volumes/db/_supabase.sql
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/db/logs.sql" -o volumes/db/logs.sql
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/db/pooler.sql" -o volumes/db/pooler.sql
|
||||
|
||||
# Vector logs configuration
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/logs/vector.yml" -o volumes/logs/vector.yml
|
||||
|
||||
# Pooler configuration
|
||||
curl -fsSL "$SUPABASE_REPO/volumes/pooler/pooler.exs" -o volumes/pooler/pooler.exs
|
||||
|
||||
# Create .env file if it doesn't exist
|
||||
if [ ! -f .env ]; then
|
||||
echo "📝 Creating .env file from .env.example..."
|
||||
cp .env.example .env
|
||||
echo ""
|
||||
echo "⚠️ IMPORTANT: Please edit .env file and update the following:"
|
||||
echo " - POSTGRES_PASSWORD"
|
||||
echo " - JWT_SECRET (generate with: openssl rand -base64 32)"
|
||||
echo " - SECRET_KEY_BASE (generate with: openssl rand -base64 32)"
|
||||
echo " - VAULT_ENC_KEY (generate with: openssl rand -base64 32)"
|
||||
echo " - PG_META_CRYPTO_KEY (generate with: openssl rand -base64 32)"
|
||||
echo " - LOGFLARE_PUBLIC_ACCESS_TOKEN (generate with: openssl rand -base64 32)"
|
||||
echo " - LOGFLARE_PRIVATE_ACCESS_TOKEN (generate with: openssl rand -base64 32)"
|
||||
echo " - DASHBOARD_USERNAME and DASHBOARD_PASSWORD"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
echo "✅ Supabase setup completed!"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Edit .env file with your configuration"
|
||||
echo "2. Ensure shared_data_network exists: cd ../00-network && bash create-network.sh"
|
||||
echo "3. Start Supabase: docker compose up -d"
|
||||
echo "4. Access Supabase Studio at: http://localhost:3010"
|
||||
echo "5. Access Supabase API at: http://localhost:8100"
|
||||
Reference in New Issue
Block a user