home-server-backup icon indicating copy to clipboard operation
home-server-backup copied to clipboard

[Feature request] Support for docker compose

Open piyushpaliwal opened this issue 1 year ago • 1 comments

I tried a proof of concept for my setup and realised that the configuration expects individual docker containers name in order to stop them and perform the backups. I see a few limitations with this approach

  • How do you maintain the order of containers because most of the times they are dependent on other containers
  • Have to explicitly mention all containers in the file; even as a poc, I reached 10-12 containers with inter linking. My production load is roughly 20 containers.

So, I am not sure if this doable or not but a possibility to utilize docker compose in order to stop containers would be great. I imagine most of the production loads might be running via docker-compose.yml.

PS: apologies if this was already covered in your documentation; if you can point me to the right direction, that would be great.

piyushpaliwal avatar Jun 28 '23 06:06 piyushpaliwal

Backup of Docker Volumes includes stopping containers by design - you don't have to configure it separately.

Backup of Docker Bind Mounts on the other hand by default don't stop the containers - assuming that those data aren't interrupting containers work. If for any reason you would like to stop the container for the time of the backup, even for Bind Mounts, you can do it by listing those containers in bindDockerStop array.

Above you can find hyperlinks to corresponding paragraphs of the Script Documentation explaining exactly what kind of data is needed for that.


Procedure of backup (assuming stopping container) will be as follow:

  1. Stopping container
  2. Performing backup
  3. Starting container

Order of containers will be as you listed them in configuration file. Volume Backups first, Bind Mounts after that.


I am aware that currently script requires a lot of data to be input manually (for each Docker Volume exact path for example) and my goal is to automate it in the future, but first I have to figure out how.


Regarding docker compose it should be relatively easy to include that script packed in docker image, to interact with other containers but for environments like mine, where I have currently 28 containers declared by 15 stacks (Portainer docker composes) it won't be suitable. Maybe you have idea / concept of the path to resolve that issue?


Thank you for contributing in that project! If you have any further questions / comments / ideas don't hesitate to write it! :smiley:

gromoslaw-kroczka avatar Jul 02 '23 20:07 gromoslaw-kroczka