Additional reading "The 12 factor app" https://12factor.net/ part 3.
Beyond this, TFA fails to mention you should have `.env` in your .gitignore file and *NOT* check this into source control. Generally speaking, I will create defaults that will work without a .env file locally if possible. I will, however, create `.env.template.env` and `.env.dev.env` files.. the prefix is to keep them together, the suffix is for my editor's plugins. The template version, I have setup for string replacement for CI/CD integration in a non-container environment... the dev version is for local development, with non-secure resources/passwords etc that are only for local dev.
Here's some boilerplate that I am using.
https://gist.github.com/tracker1/7fd48e818f3b80c8266f04029e989f59