3 ms·
Indeed, the whole point of the 12 factor design is to decouple the app from a single config file. Instead you use whatever method you like to define environment
by mangecoeur 4y ago
Indeed, the whole point of the 12 factor design is to decouple the app from a single config file. Instead you use whatever method you like to define environment variables and the app should just work. Also helps avoid committing secrets to your git repo.
I use SystemD extensively and it's pretty neat, you just:
- Define default Environment variables in your unit file
- Customize a service by adding an overrides.conf file in foo.service.d/ folder
This makes it easy to define exactly the environment for a service.
.env files are helpful in dev mode to customise machines where I don't want to pollute the system env, but they aren't the 'config format' and it makes sense that they are specific to the OS/shell they need to run in.