How access env variable in edge function (self hosted) ?
Well I guess we are supposed to add
.env
in /functions/.env
but even doing it, env var only contain :
But adding a custom one in .env
file isnt working... What do I miss ?2 Replies
In my VPS I have :
So there is my
.env
Okay I found, well the doc is kinda broken for this, but we have to add env_file
inside the docker compose :
Hi @loup
For self-hosted projects the
Enviroment variables
are injected to workers from Main.
Like you can see on this line by default it will get the currently container environments and foward it to workers.
But you can extend it with your own custom logic, like search for the .env
file at same way it already search for the "service_path"
, then you can extend the envVars
object with the contents of the found local .env
file. This way you don't need to manually include it into your docker-compose