How do you make Doco-CD read an .env properly without having to copy it? #1628
|
This may sound like a dumb question, but hold on. I have a Docker VM running in Proxmox, and I use Doco-CD, which I love to use by the way. It's just that with some applications, I notice they sometimes require .env files. So what I do is reference them with Doco-CD, no problem there. However, I obviously don't commit secrets to my (private) repository, and that's
This all sounds too complicated, and I believe I'm doing it wrong. Doco-CD should be much easier than this, can't imagine others also do it this 'complicated'. |
Replies: 4 comments 1 reply
|
I use SOPS to encrypt secrets and share the SOPS Age key with Encrypt every secret file with SOPS and commit the encrypted files to the Git repository. Alternatively, you can keep your |
|
If you use Docker swarm, you can create Docker secrets and reference them in your stacks. Otherwise I also do it like @qianlongzt |
|
Thanks for the replies. It's not just for secrets, but for .env files in general. How it works now is just a hassle (not blaming Doco-CD here, because I don't know how you'd solve this): let's say you deploy Immich. That application requires a What do you mean with keeping |
|
I looked into it again, and I think there's no other way than using SOPS. Seems reasonably easy to maintain/deploy/use, so I think I'll go with that. Thanks for the replies! |
I use SOPS to encrypt secrets and share the SOPS Age key with
doco-cdand myself. It's not the best practice, but it's sufficient for a homelab.Encrypt every secret file with SOPS and commit the encrypted files to the Git repository.
doco-cdshould start with access to the SOPS Age key so it can decrypt the secrets at runtime.Alternatively, you can keep your
.envfile outside the repository and configuredoco-cdto mount it. You may need to specify the environment file explicitly. In this setup, make sure to keep.envand.env.examplein sync.