4 ms·
Ask HN: The secure ways to store env files without storing in Git repo?
Where should I put my production config?
- PaulHoule 4y agoIn a dot file.
- Jugurtha 4y agoYou create a gitignore file so that your production dotfiles, say `.env` do not get accidentally tracked or committed. You create a config file named `.env.example`, which is tracked and committed, that contains the environment variables with default/placeholder values. The first time you deploy something, you copy `.env.example` to `.env`. Then you change the values of the environment variables in `.env` with production values. As you develop the project, you'll remove and most likely add environment variables as you extract hard coded things from code into the config file. You'll commit these changes to `.env.example` and then to `.env`
- dev_0 4y agoI am talking about how my web server can read the env values without pushing the config files in the container images?
- Jugurtha 4y ago"The bear is sticky with honey": https://youtube.com/watch?v=i92Ws7qPTRg https://youtube.com/watch?v=i92Ws7qPTRg
- rovr138 4y agoDocker? --env-file Read in a file of environment variables https://docs.docker.com/engine/reference/commandline/run/ https://docs.docker.com/engine/reference/commandline/run/