supabase start does not load environment variable #30093
Replies: 1 comment
-
For future reference: The command "supabase start" will use the docker-compose.yaml from supabase with additional configuration including the config.toml. The specific services only have access to the predfined environment variables. In this case a custom value as example "SUPABASE_API_URL" will not work. Also a value like "API_EXTERNAL_URL" can not be used because it is not defined for this docker service. As a workaround it is possible to misuse the "OPENAI_API_KEY". A other solution is to selfhost supabase for development. But there will be many additional things to consider. As example implementation of the config.toml in a selfhosted environment, setting up everything based on the supabase linked project and many more things. [studio]
enabled = true
# Port to use for Supabase Studio.
port = 54323
# External URL of the API server that frontend connects to.
api_url = "env(OPENAI_API_KEY)"
# OpenAI API Key to use for Supabase AI in the Supabase Studio.
openai_api_key = "env(OPENAI_API_KEY)" Edit: This suddenly stopped working for some unknown reason. |
Beta Was this translation helpful? Give feedback.
-
Hi, i tried many different solution but couldn't fix my problem. When i access supabase dashboard from supabase start with an custom domain supabase.mydomain.com, i have to change api_url in the config.toml file so it possible to create accounts, because it has to access the api url on the reverse proxy.
This works as it should. But when i try to use the environment variable like this:
it does not work anymore. In the browser console i can see it tries to use localhost. Summarized i do not know why supabase start does not load my environment variables. I tried to something like "dotenv -e .env -- supabase start" or "export SUPABASE_API_URL="https://api.mydomain.com" without success. Do i missing something? Can i somehow debug or log the start process to see why it is not working?
Beta Was this translation helpful? Give feedback.
All reactions