There's a lot of programs out there that can utilize .env
files. Most of them support the basic bash-syntax, others support more advanced things like templating within the .env
files. The way you're supposed to use .env
files varies a lot as well. Often in this context, you'll year from the 12-factor-app which states that you should export (some) configuration as environment variables, that apparently lead to two use cases:
dotenv
programs do just that: you prefix your command on the shell with dotenv
and the variables in the dotenv file will magically be available in you process..env
files from within your code -- a very different approach since your code is suddenly interpreting .env
files directly and does not "see" the environment variables anymore.Since there's so many different interpretations of usage, use-cases and syntax, is there a proper definition of .env
files or some commonly accepted standard? If not, at least some historical references?
It appears that .env
files lack a complete definition.
This reference:
https://devcenter.heroku.com/articles/heroku-local
Links here:
http://blog.daviddollar.org/2011/05/06/introducing-foreman.html
Which leads here:
https://ddollar.github.io/foreman/
Which contains this:
ENVIRONMENT
If a .env file exists in the current directory, the default
environment will be read from it. This file should contain key/value
pairs, separated by =, with one key/value pair per line.
FOO=bar
BAZ=qux
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With