environ
environ copied to clipboard
Feature request: support for docker style .env files
docker supports specifying environment vars using the --env-file
flag.
It would be great if environ could also incorporate this type of file. This would look something like:
> cat .env
FOO=bar
S3_KEY=12345
@weavejester would you be open to a pr for something like this?
Thanks!
Don't most of the tools that use .env
set the environment anyway?
in my case specifically, I intend to use the .env
file to provision my docker container when running in production. When developing locally I want to use that same file to inject development env vars
not sure I've seen many tools that set .env
, most of them read from it
Ran into the same use case. Would be quite nice to have it supported.
There's https://github.com/tpope/lein-dotenv if that's applicable to your problems.
Support for .env
files would be really nice. This approach is well-known from Heroku and several programming language communities (e.g. Ruby and Node.js).
agreed dotenv would be nice to use, coming from python and docker you specify your settings in .env files and load them in to configure your services for your environments, in the case of docker this is extra helpful as you may want to share things like database uri's between containers.
I look for a suggestion regarding my type of an issue. I guess this is what most of the commenters touch upon but don't refine enough.
In some react projects we use .config
file and development app startup crashes if that file doesn't exist. On production everything is compiled into JS files and file loading is not performed.
Upon the first clone of the app the developer is forced to create this .config
file (copy it from some kind of location like .config.example
).
For development it's nice to have this file added to .gitignore
and force the developer to read the file with any local variables.
These local variables that I refer to are those that are different per person and machine.
I think it's hard to force Android studio location or the same IP address. Let's be clear here, Android studio binaries are in different locations in Windows and GNU+Linux.
So by using environ the developer is forced to not commit his version of project.clj
file or load the environment vars into the shell (REPL too).
If I understand correctly environ devs want to be as non-intrusive as possible and this is great. This crash that is supposed to happen (by me) may not fall into 12factor™ app since there is mostly small amount of developers in a Clojure project.
What I want to ask is a similar project to what I described.