What’s the Best Way to Backup Multiple Docker Compose Files?

0
25
Asked By CuriousCoder87 On

I've got all my services running in Docker containers, each in its own directory on my filesystem. For example, Immich is located at `/home/me/Docker/Immich/`, which contains the relevant docker-compose and .env files, along with data stored as bind mounts. I'm in the process of migrating to a new VPS provider since my current one is going out of business. I've explored various backup options like Offen, but they tend to work best with single large compose files. I could just tar up the whole Docker directory, but I also have some volumes that aren't bind mounts and need to make sure those are included in the backup. I'm comfortable using the command line, so I'm looking for the best practices for backing up and restoring my setup. Any advice?

3 Answers

Answered By DataDude85 On

For managing your compose files and .envs, using Git is a solid option. You can track changes and roll back if needed. For securing secret .env files, try Sops. As for data directories, I’d recommend using SCP since it leverages SSH for transfers. It's reliable and straightforward.

CuriousCoder87 -

I get that Git is great, but I've had some pretty unfortunate experiences with it. I guess I’m a bit of a 'gitiot' if I’m being honest!

Answered By TechSavant42 On

I wouldn't recommend running Docker on a VPS without a backup strategy. For your case, Duplicati could work wonders. It allows you to back up your entire stack folder (including your `docker-compose.yaml` and `.env` files) along with your data folder. Plus, you can set it to stop Docker before the backup and restart it afterward, making it seamless.

Answered By BackupBuddy99 On

Have you tried using Codex for generating backup scripts? It could simplify the process for you! Just set it up to handle backups, and it can take care of the rest.

CuriousCoder87 -

Thanks for the suggestion! What exactly is Codex? Any specific site I should check out for details?

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.