DEV Community

Discussion on: Where do you store your .env files?

Collapse
 
endorama profile image
Edoardo Tenani • Edited

If you do dotenv sensibly, there should be no need to be shared in the team.

It's true that 12factor app ask you to out configuration in the environment, but this does not mean to add them in a .env file.

Put only personal configuration there, like your token for a service, and put every other configuration in committed configuration files.

If you go down this path you will find that .env are very personal and thus there should be no need to share them.

If for some special reason you need to share them, encrypt them and share any way you like. gpg or a service like onetimesecret.com/ may come handy.

The only other path, but beware that may have some unintended consequences, is to commit a .env.default sort of file that each Dev has to copy and fill appropriately.

May I ask you what configurations are in your .env file?