Self-hosting: Kong cannot resolve realtime service
Hi,
On my self-hosted Supabase setup, the realtime service is not working. Kong logs show this error:
DNS resolution failed: dns server error: 3 name error
Tried: ["realtime-dev.supabase-realtime:1 ..."]
But the actual container name looks like this:
realtime-dev.<CONTAINER_PREFIX>-realtime
So Kong is trying to reach realtime-dev.supabase-realtime, but it doesn’t exist.
Is there an environment variable (e.g. REALTIME_URL or similar) to configure this? Or is the recommended way to solve it by adding a Docker network alias?
6 Replies
Have you modified the compose file config? How are you self-hosting supabase?
Yes, I modified the compose file slightly.
I’m self-hosting Supabase using Dokploy’s ready-made docker compose template on my own server. Everything works fine except Realtime — Kong cannot resolve the Realtime URL. Current Realtime service config: realtime: container_name: realtime-dev.${CONTAINER_PREFIX}-realtime image: supabase/realtime:v2.34.47 restart: unless-stopped depends_on: db: condition: service_healthy analytics: condition: service_healthy healthcheck: test: ["CMD", "curl", "-sSfL", "--head", "-o", "/dev/null", "-H", "Authorization: Bearer ${ANON_KEY}", "http://localhost:4000/api/tenants/realtime-dev/health"] timeout: 5s interval: 5s retries: 3 environment: PORT: 4000 DB_HOST: ${POSTGRES_HOST} DB_PORT: ${POSTGRES_PORT} DB_USER: supabase_admin DB_PASSWORD: ${POSTGRES_PASSWORD} DB_NAME: ${POSTGRES_DB} DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime' DB_ENC_KEY: supabaserealtime API_JWT_SECRET: ${JWT_SECRET} SECRET_KEY_BASE: ${SECRET_KEY_BASE} ERL_AFLAGS: -proto_dist inet_tcp DNS_NODES: "''" RLIMIT_NOFILE: "10000" APP_NAME: realtime SEED_SELF_HOST: true RUN_JANITOR: true I also tried adding a network alias: networks: default: aliases: - realtime-dev.supabase-realtime But Kong still cannot resolve the service.
I’m self-hosting Supabase using Dokploy’s ready-made docker compose template on my own server. Everything works fine except Realtime — Kong cannot resolve the Realtime URL. Current Realtime service config: realtime: container_name: realtime-dev.${CONTAINER_PREFIX}-realtime image: supabase/realtime:v2.34.47 restart: unless-stopped depends_on: db: condition: service_healthy analytics: condition: service_healthy healthcheck: test: ["CMD", "curl", "-sSfL", "--head", "-o", "/dev/null", "-H", "Authorization: Bearer ${ANON_KEY}", "http://localhost:4000/api/tenants/realtime-dev/health"] timeout: 5s interval: 5s retries: 3 environment: PORT: 4000 DB_HOST: ${POSTGRES_HOST} DB_PORT: ${POSTGRES_PORT} DB_USER: supabase_admin DB_PASSWORD: ${POSTGRES_PASSWORD} DB_NAME: ${POSTGRES_DB} DB_AFTER_CONNECT_QUERY: 'SET search_path TO _realtime' DB_ENC_KEY: supabaserealtime API_JWT_SECRET: ${JWT_SECRET} SECRET_KEY_BASE: ${SECRET_KEY_BASE} ERL_AFLAGS: -proto_dist inet_tcp DNS_NODES: "''" RLIMIT_NOFILE: "10000" APP_NAME: realtime SEED_SELF_HOST: true RUN_JANITOR: true I also tried adding a network alias: networks: default: aliases: - realtime-dev.supabase-realtime But Kong still cannot resolve the service.
You'll also have to update url in kong.yml, here https://github.com/supabase/supabase/blob/master/docker/volumes/api/kong.yml#L137 and here https://github.com/supabase/supabase/blob/master/docker/volumes/api/kong.yml#L157
and you can remove any additional networks config you've added
I’m considering either editing the Kong config directly via terminal or switching to Coolify. I have a fresh hosting setup and I’m testing everything. I really like Dokploy so far, but do you think Coolify would be a better choice for these kinds of setups and features?
I’ve started considering switching because the Docker volume configs aren’t visible in Dokploy.
I used coolify and dokploy about a month ago when another user was facing some issues. Back then coolify supabase template had more recent img versions than dokploy. Don't know about the versions now. I believe you have the option to import github repo in both platforms.
I've imported github repo in coolify before, not sure about dokploy. That will be a better option imo
Thanks a lot! I’ve set up Coolify on my server instead of Dokploy, and I haven’t run into this issue. I can see now that Coolify is indeed the better option for this setup.