Possible to hit localhost from db and+or edge functions?
I am trying to stick to a fully local development setup (locally) and am having troubles making requests to localhost from both a postgres function, or from an Edge Function. I know that both are ran via the Docker setup from the Supabase CLI, but I've tried about every combination of things I can try in order to make requests to localhost.
I've realized that localhost from the context of a Docker container, is just that container, not the machine's localhost. As an attempted work around for this, I've tried hitting the exposed Docker IP (in my case
I plan on storing the url's using Supabase Vault secrets, which will allow me to have different values for different Supabase environments (eg localhost:3000, staging.app.com, production.app.com etc) and reference those variables within my functions or Edge Functions. I just can't seem to get it wired up to my locally ran services. Any help would be appreciated.
Here's some example database functions
Tried localhost, that doesnt work since these services aren't ran from within the Supabase local Docker container
Tried adding a recoerd to hosts to listen at a URL vs localhost but no luck
Any help would be appreciated. Getting this nailed down would really help me get a great local dev setup going!
I've realized that localhost from the context of a Docker container, is just that container, not the machine's localhost. As an attempted work around for this, I've tried hitting the exposed Docker IP (in my case
172.25.145.178) in the database functions and/or Edge functions, but that doesn't work. I've also added a URL to my hosts config locally so that the IP above can accept requests at a URL vs an IP (eg app.local -> 172.25.145.178) which exposes my Nextjs web app and search service to their corresponding ports at app.local, but that doesn't work in the database either. I plan on storing the url's using Supabase Vault secrets, which will allow me to have different values for different Supabase environments (eg localhost:3000, staging.app.com, production.app.com etc) and reference those variables within my functions or Edge Functions. I just can't seem to get it wired up to my locally ran services. Any help would be appreciated.
Here's some example database functions
Tried localhost, that doesnt work since these services aren't ran from within the Supabase local Docker container
Tried adding a recoerd to hosts to listen at a URL vs localhost but no luck
Any help would be appreciated. Getting this nailed down would really help me get a great local dev setup going!