feat: add SUPABASE_HOSTNAME env var to override local service host#4947
feat: add SUPABASE_HOSTNAME env var to override local service host#4947
Conversation
Allows the CLI to work correctly when run inside a dev container with the Docker socket bind-mounted. In that context 127.0.0.1 is the container's own loopback, not the Docker host. Set SUPABASE_HOSTNAME=host.docker.internal to reach sibling containers via Docker Desktop's host gateway without proxying the Docker socket. --- AI assistance: Claude Sonnet 4.6 in Pi Agent - Used to find root cause, propose fix options, draft code/test/docs. - I ran supabase start inside the dev container, confirmed all services healthy, reviewed/edited all code changes/text.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe changes add support for a new SUPABASE_HOSTNAME environment variable to allow users to override the hostname used when the CLI runs inside a dev container with Docker socket bind-mounted. The GetHostname function in internal/utils/misc.go is updated to check this environment variable first, and if set, returns its value; otherwise, it retains the existing logic of deriving the host from Docker.DaemonHost(). Documentation is added to advise users on setting this variable, and tests are added to verify the environment-based behavior of the GetHostname function. Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Pull Request Test Coverage Report for Build 22911967653Details
💛 - Coveralls |
Allows the CLI to work correctly when run inside a dev container with the Docker socket bind-mounted. In that context 127.0.0.1 is the container's own loopback, not the Docker host.
Set
SUPABASE_HOSTNAME=host.docker.internalto reach sibling containers via Docker Desktop's host gateway without proxying the Docker socket.AI assistance: Claude Sonnet 4.6 in Pi Agent
What kind of change does this PR introduce?
Feature
What is the current behavior?
If
supbase startis run from a sibling container (e.g. with /var/run/docker.sock mounted from the host), the command is unable to connect to the those containers after starting them in order to do health checks:What is the new behavior?