- Add docker-compose.sh wrapper script that auto-detects host IP - Update docker-compose.yml to use environment variable substitution - Update Supabase config.toml files to use HOST_SITE_URL and SUPABASE_API_URL env vars - Add scripts/get-host-ip.sh for IP detection - Add scripts/set-host-env.sh for environment setup - Add scripts/supabase-with-env.sh wrapper for Supabase CLI - Add documentation for Docker Compose environment setup - Update README.md with new usage instructions - Replace hardcoded URLs with dynamic environment variables
25 lines
761 B
Bash
Executable File
25 lines
761 B
Bash
Executable File
#!/bin/bash
|
|
# Wrapper script for Supabase CLI that automatically sets HOST_SITE_URL
|
|
# Usage: ./scripts/supabase-with-env.sh <supabase-command> [args...]
|
|
|
|
# Get the script directory
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
# Source the environment setup script
|
|
source "$SCRIPT_DIR/set-host-env.sh"
|
|
|
|
# Change to project root (Supabase CLI looks for supabase/ directory)
|
|
cd "$PROJECT_ROOT" || exit 1
|
|
|
|
# Check if supabase command exists
|
|
if ! command -v supabase >/dev/null 2>&1; then
|
|
echo "Error: Supabase CLI is not installed or not in PATH" >&2
|
|
echo "Install it from: https://supabase.com/docs/guides/cli" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Run the supabase command with all arguments
|
|
exec supabase "$@"
|
|
|