Just curious if there is an easy way to back up my docker-compose.yaml and .env files. I have the following directory structure for my containers:

-docker
  -<name of container>
    -.env
    -docker-compose.yml

I’d like to copy those two files for each container folder but no other subfolders that may also be in the container folder (config, data, etc). I’ve been trying to get my restic backups to do it but I just can’t figure it out.

Is there a better way? I’d like to have backups in case my entire server dies.___

  • RegalPotoo@lemmy.world
    link
    fedilink
    English
    arrow-up
    2
    ·
    edit-2
    2 days ago

    Check them into Git, but be cautious about credentials that might live in the env files that you don’t want to expose if you end up making the repo publicly available.

    • grimer@lemmy.worldOP
      link
      fedilink
      English
      arrow-up
      1
      ·
      2 days ago

      That is an option I’ve been thinking about but I’ve never used it, I’m not a dev. Maybe I’ll look at it more seriously since it does sound like what would work best, I’d really apprecieate the versioning. Thanks!

  • dohpaz42@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    2 days ago

    As a Mac user, I like Time Machine for backups. It’s not perfect, but it gets the job done. There is a Linux version.

    Nb. I’ve not used this particular software, so YMMV.