Fix domain configuration for separate portal and API domains
Build and Push Docker Image / build (push) Successful in 1m59s Details

- Changed from single DOMAIN variable to PORTAL_DOMAIN and API_DOMAIN
- Matches nginx config: portal.monacousa.org, api.monacousa.org, studio.monacousa.org
- Updated docker-compose.yml to use correct domain variables with defaults
- Updated setup.sh to validate both domain variables
- Updated .env.example with separate domain configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-01-26 11:34:25 +01:00
parent c92a7ee9b8
commit dec5e1950e
3 changed files with 16 additions and 9 deletions

View File

@ -11,8 +11,14 @@
# ============================================
# DOMAIN CONFIGURATION (Required)
# ============================================
# Your domain name (without https://)
DOMAIN=portal.monacousa.org
# Portal domain (main web app)
PORTAL_DOMAIN=portal.monacousa.org
# API domain (Supabase API gateway)
API_DOMAIN=api.monacousa.org
# Studio domain (Supabase dashboard - optional)
STUDIO_DOMAIN=studio.monacousa.org
# ============================================
# DATABASE CONFIGURATION

View File

@ -66,7 +66,7 @@ services:
DEFAULT_ORGANIZATION_NAME: Monaco USA
DEFAULT_PROJECT_NAME: Monaco USA Portal
SUPABASE_URL: http://kong:8000
SUPABASE_PUBLIC_URL: https://api.${DOMAIN}
SUPABASE_PUBLIC_URL: https://${API_DOMAIN:-api.monacousa.org}
SUPABASE_ANON_KEY: ${ANON_KEY}
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
depends_on:
@ -119,12 +119,12 @@ services:
environment:
GOTRUE_API_HOST: 0.0.0.0
GOTRUE_API_PORT: 9999
API_EXTERNAL_URL: https://api.${DOMAIN}
API_EXTERNAL_URL: https://${API_DOMAIN:-api.monacousa.org}
GOTRUE_DB_DRIVER: postgres
GOTRUE_DB_DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?search_path=auth
GOTRUE_SITE_URL: https://${DOMAIN}
GOTRUE_SITE_URL: https://${PORTAL_DOMAIN:-portal.monacousa.org}
GOTRUE_URI_ALLOW_LIST: ${ADDITIONAL_REDIRECT_URLS:-}
GOTRUE_DISABLE_SIGNUP: ${DISABLE_SIGNUP:-false}
@ -341,12 +341,12 @@ services:
ports:
- "127.0.0.1:7453:3000"
environment:
PUBLIC_SUPABASE_URL: https://api.${DOMAIN}
PUBLIC_SUPABASE_URL: https://${API_DOMAIN:-api.monacousa.org}
PUBLIC_SUPABASE_ANON_KEY: ${ANON_KEY}
SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
SUPABASE_INTERNAL_URL: http://kong:8000
NODE_ENV: production
ORIGIN: https://${DOMAIN}
ORIGIN: https://${PORTAL_DOMAIN:-portal.monacousa.org}
BODY_SIZE_LIMIT: ${BODY_SIZE_LIMIT:-52428800}
depends_on:
kong:

View File

@ -165,7 +165,8 @@ set -e
# Validate required variables
echo "Validating required variables..."
REQUIRED_VARS=(
"DOMAIN"
"PORTAL_DOMAIN"
"API_DOMAIN"
"POSTGRES_USER"
"POSTGRES_PASSWORD"
"POSTGRES_DB"
@ -247,7 +248,7 @@ echo "Next steps:"
echo " 1. Review .env and configure any remaining settings"
echo " 2. Start the services: docker compose up -d"
echo " 3. Wait for all containers to be healthy: docker compose ps"
echo " 4. Access the portal at: https://${DOMAIN:-your-domain.com}"
echo " 4. Access the portal at: https://${PORTAL_DOMAIN:-portal.monacousa.org}"
echo " 5. Create your admin account on first visit"
echo ""
echo "Useful commands:"