From c2b233774feb16471cfae65b36865f0f28ab774e Mon Sep 17 00:00:00 2001 From: Ye Liu Date: Sun, 15 Feb 2026 02:23:29 -0500 Subject: [PATCH] Fix realtime service name resolution (#563) Expose the CONTAINER_PREFIX environment variable to kong service, then utilize it to format the URL of realtime service. --- blueprints/supabase/docker-compose.yml | 1 + blueprints/supabase/template.toml | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/blueprints/supabase/docker-compose.yml b/blueprints/supabase/docker-compose.yml index 7d4dae81..506ddc90 100644 --- a/blueprints/supabase/docker-compose.yml +++ b/blueprints/supabase/docker-compose.yml @@ -77,6 +77,7 @@ services: SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY} DASHBOARD_USERNAME: ${DASHBOARD_USERNAME} DASHBOARD_PASSWORD: ${DASHBOARD_PASSWORD} + CONTAINER_PREFIX: ${CONTAINER_PREFIX} # https://unix.stackexchange.com/a/294837 entrypoint: bash -c 'eval "echo \"$$(cat ~/temp.yml)\"" > ~/kong.yml && /docker-entrypoint.sh kong docker-start' diff --git a/blueprints/supabase/template.toml b/blueprints/supabase/template.toml index 9f35f79c..f70c93cc 100644 --- a/blueprints/supabase/template.toml +++ b/blueprints/supabase/template.toml @@ -309,7 +309,7 @@ services: ## Secure Realtime routes - name: realtime-v1-ws _comment: 'Realtime: /realtime/v1/* -> ws://realtime:4000/socket/*' - url: http://realtime-dev.supabase-realtime:4000/socket + url: http://realtime-dev.${CONTAINER_PREFIX}-realtime:4000/socket protocol: ws routes: - name: realtime-v1-ws @@ -329,7 +329,7 @@ services: - anon - name: realtime-v1-rest _comment: 'Realtime: /realtime/v1/* -> ws://realtime:4000/socket/*' - url: http://realtime-dev.supabase-realtime:4000/api + url: http://realtime-dev.${CONTAINER_PREFIX}-realtime:4000/api protocol: http routes: - name: realtime-v1-rest @@ -850,7 +850,7 @@ transforms: kong: '.appname == "supabase-kong"' auth: '.appname == "supabase-auth"' rest: '.appname == "supabase-rest"' - realtime: '.appname == "realtime-dev.supabase-realtime"' + realtime: '.appname == "realtime-dev.${CONTAINER_PREFIX}-realtime"' storage: '.appname == "supabase-storage"' functions: '.appname == "supabase-edge-functions"' db: '.appname == "supabase-db"'