For user-readable files or media I store them under ~/docker/data, and for everything else I store them under ~/docker/stacks/[service] where ~/docker/stacks is maintained by Dockge.

Is there a better way to do this?

  • Damarus@feddit.org
    link
    fedilink
    English
    arrow-up
    10
    ·
    4 months ago

    I have multiple compose stacks with one folder each, and they also contain all the bind volumes and any other extra files needed.

    • fizzle@quokk.au
      link
      fedilink
      English
      arrow-up
      2
      ·
      4 months ago

      This is me.

      For example, /srv/docker/synching contains:

      compose.yml .env ./Sync

      That last one is a directory bound to the container which contains all my sync folders.

      Occasionally it makes more sense to put the mounted folder in /srv like /srv/photos is mounted by /srv/docker/photoprism/compose.yml

      However, thats a rarity. Things mostly accessed by a single compose stack are kept alongside the other files for that stack.

  • tal@lemmy.today
    link
    fedilink
    English
    arrow-up
    2
    ·
    4 months ago

    Bind mounts aren’t specific to Docker. You’re asking specifically about bind mounts as used by Docker?

  • TheHolm@aussie.zone
    link
    fedilink
    English
    arrow-up
    0
    ·
    4 months ago

    If you using bind mounts - you are using dockers in wrong way. Use named volumes.

  • TheRagingGeek@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    2
    ·
    4 months ago

    I run a swarm and the NAS~esque machine has its exportfs entries under /export so all my docker persistence data goes into /export/docks/<stackname>/<service>/<mount>

  • HereIAm@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    2
    ·
    4 months ago

    I didn’t think much of what the “correct” location would be. But i have a general kinda everything share at /var/share/[music,books,video,user folders,repo]. And then any caching or config data sits in that dockers home folder under /etc/docker/[jellyfin,immich,kavita,etc] together with its docker-compose file. All docker services run under the group user so they all have access to the share.