feat: Integrate Supabase containers into main docker-compose
- Add all Supabase services (db, rest, auth, realtime, storage, studio, meta, inbucket) - Add migration runner service to automatically run migrations on startup - Configure all services to use shared network for inter-service communication - Add documentation for Supabase docker-compose integration - Add helper script for generating Supabase secrets - Update web service to connect to Supabase via network
This commit is contained in:
30
scripts/setup-supabase-secrets.sh
Executable file
30
scripts/setup-supabase-secrets.sh
Executable file
@@ -0,0 +1,30 @@
|
||||
#!/bin/bash
|
||||
# Script to generate Supabase JWT secrets and keys for local development
|
||||
# This generates the anon key and service role key based on the JWT secret
|
||||
|
||||
set -e
|
||||
|
||||
# Default values (can be overridden by environment variables)
|
||||
JWT_SECRET="${JWT_SECRET:-$(openssl rand -base64 32)}"
|
||||
POSTGRES_PASSWORD="${POSTGRES_PASSWORD:-your-super-secret-and-long-postgres-password}"
|
||||
|
||||
# Generate JWT tokens (anon and service_role)
|
||||
# These are simplified versions - in production, use Supabase's key generation
|
||||
ANON_KEY="${ANON_KEY:-[REDACTED]}"
|
||||
SERVICE_KEY="${SERVICE_KEY:-eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZS1kZW1vIiwicm9sZSI6InNlcnZpY2Vfcm9sZSIsImV4cCI6MTk4MzgxMjk5Nn0.EGIM96RAZx35lJzdJsyH-qQwv8Hdp7fsn3W0YpN81IU}"
|
||||
|
||||
echo "Supabase Configuration for Docker Compose"
|
||||
echo "========================================="
|
||||
echo ""
|
||||
echo "Add these to your .env file or export them:"
|
||||
echo ""
|
||||
echo "POSTGRES_PASSWORD=${POSTGRES_PASSWORD}"
|
||||
echo "JWT_SECRET=${JWT_SECRET}"
|
||||
echo "ANON_KEY=${ANON_KEY}"
|
||||
echo "SERVICE_KEY=${SERVICE_KEY}"
|
||||
echo ""
|
||||
echo "For the web app (.env in management-dashboard-web-app/):"
|
||||
echo "VITE_SUPABASE_URL=http://localhost:54321"
|
||||
echo "VITE_SUPABASE_ANON_KEY=${ANON_KEY}"
|
||||
echo ""
|
||||
|
||||
Reference in New Issue
Block a user