

31·
9 months agoI have mine in git! I have:
-docker
- .env
- <thing name>
- dockers-compose.yml
Then using docker compose --env-file ../.env -v up -d it uses the above .env file. (../ means up one folder)
For more details and a bunch of my compose files checkout my repo! https://github.com/shadybraden/homelab/tree/main/docker
Definitely worth a shot.
One thing I do to prevent stuff from getting into a public git repo is:
.gitignorethen add the line.envto it. Then git will ignore any file named.envsudo nano) by runningsudo chmod 600 .env && sudo chown root:root .env