feat: Add dynamic host IP detection for Docker Compose and Supabase config

- 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
This commit is contained in:
salirezav
2025-12-18 19:57:27 -05:00
parent 8cb45cbe03
commit 8f4225a62e
10 changed files with 603 additions and 17 deletions

View File

@@ -82,7 +82,9 @@ enabled = true
# Port to use for Supabase Studio.
port = 54323
# External URL of the API server that frontend connects to.
api_url = "http://exp-dash"
# Uses SUPABASE_API_URL environment variable (set by docker-compose.sh)
# Format: http://<host-ip>:54321
api_url = "env(SUPABASE_API_URL)"
# OpenAI API Key to use for Supabase AI in the Supabase Studio.
openai_api_key = "env(OPENAI_API_KEY)"
@@ -118,9 +120,13 @@ file_size_limit = "50MiB"
enabled = true
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
# in emails.
site_url = "http://exp-dash:3000"
# Uses HOST_SITE_URL environment variable, which should be set to the full URL (e.g., http://<host-ip>:3000)
# Set this via: export HOST_SITE_URL="http://$(./scripts/get-host-ip.sh):3000"
# Or manually: export HOST_SITE_URL="http://192.168.1.100:3000"
site_url = "env(HOST_SITE_URL)"
# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
additional_redirect_urls = ["https://exp-dash:3000"]
# Uses HOST_SITE_URL environment variable (same as site_url)
additional_redirect_urls = ["env(HOST_SITE_URL)"]
# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week).
jwt_expiry = 3600
# If disabled, the refresh token will never expire.