Docker networking issue with Supabase connection after migrating from Docker Desktop to native Docker #863
Replies: 1 comment
-
|
Here's the solution for GitHub: Solution: Allow Docker container names in Supabase URL validation The issue was that the Fix: In Option 1: Add specific container name python # Check for exact localhost and Docker internal hosts (security: prevent subdomain bypass)
local_hosts = ["localhost", "127.0.0.1", "host.docker.internal", "supabase-kong"]
if hostname in local_hosts or hostname.endswith(".localhost"):
return TrueOption 2: Allow all Docker container names (recommended) python # Check for exact localhost and Docker internal hosts
local_hosts = ["localhost", "127.0.0.1", "host.docker.internal"]
# Allow Docker container names (hostnames without dots)
if hostname in local_hosts or hostname.endswith(".localhost") or "." not in hostname:
return TrueConfiguration: In env SUPABASE_URL=http://supabase-kong:8000In yaml services:
archon-server:
networks:
- app-network
- supabase_default # External Supabase network
networks:
app-network:
driver: bridge
supabase_default:
external: trueWhy this works:
This solution works for native Docker on Linux where |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description:
I'm experiencing connectivity issues with Archon after migrating from Docker Desktop to native Docker on Linux (due to conflicts with NVIDIA Container Toolkit).
Environment:
OS: Linux
Docker: Native Docker (not Docker Desktop)
Supabase: Running in Docker container supabase-kong on port 8000
Network: supabase_default bridge network
Problem:
Previously with Docker Desktop, this configuration worked:
envSUPABASE_URL=http://host.docker.internal:8000
httpx.ConnectTimeout: timed out
Error loading credentials: timed out
ConfigurationError: Supabase URL must use HTTPS for non-local environments (hostname: supabase-kong)
Using IP 172.17.0.1:8000: Connection timeout from within container
Current docker-compose.yml configuration:
Services connected to both app-network and supabase_default networks
extra_hosts includes host.docker.internal:host-gateway
Expected behavior:
Archon services should connect to local Supabase container using HTTP without HTTPS validation errors.
Possible solutions:
Add supabase-kong to allowed local hostnames in validate_supabase_url() function
Add environment variable to disable HTTPS validation for local development (e.g., DISABLE_SSL_VALIDATION=true)
Update documentation for native Docker deployment
Question:
What is the recommended way to configure SUPABASE_URL when both Archon and Supabase are running in Docker containers on the same machine using native Docker (not Docker Desktop)?
Beta Was this translation helpful? Give feedback.
All reactions