shadybraden
@shadybraden@programming.dev
This is a remote user, information on this page may be incomplete. View at Source ↗
- Comment on Backup compose and env files 1 week ago:
You can specify a folder in your files for configs, and a different one for the compose and env:
- config - <container_config> - docker - container - compose.yml
- Comment on Backup compose and env files 1 week ago:
Definitely worth a shot.
One thing I do to prevent stuff from getting into a public git repo is:
- In the git repo, make a file called
.gitignore
then add the line.env
to it. Then git will ignore any file named.env
- edit compose files from a computer that is separate from the one that gets secrets. I have my desktop setup to push to github. Then I make a change, then simply run `git pull on my server to download the changes.
- make the .env only viewable by root (you’ll have to use
sudo nano
) by runningsudo chmod 600 .env && sudo chown root:root .env
- In the git repo, make a file called
- Comment on Backup compose and env files 1 week ago:
I 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! github.com/shadybraden/homelab/tree/main/docker