Hoping for some help with a novice please.

My aim here is just to have somewhere I can easily reference where i’m storing the data as I add more and more stacks.

in Portainer (BE 2.19.1) I’ve created a volume called ‘my_data’. When I look at Portainer volumes it has in the mount point ‘/var/lib/docker/volumes/my_data/_data’. So thats where I’ve put some of the config files and other persistent data I want to use.

I want to use the ‘my_data’ Volume in multiple stacks (using docker compose) as the persistent data storage. I thought I’d be able to say in my compose:

volumes:

`- my_data/changedetection/datastore:/datastore`

However this gives the error:

failed to deploy a stack: service "changedetection" refers to undefined volume my_data/changedetection/datastore: invalid compose project

  1. Do I need to have one Volume for every stack so I would just say my_data:/datastore?
  2. Am I better off just ignoring Volumes and putting my persistent files somewhere like /data/my_data/ ?
  3. Am I asking the wrong questions :)

  • AlternativeBasis@alien.topB
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    I always use external and absolute paths in every app

    • /home/myuser/docker/myapp/config:/config
    • /data/media:/media

    Easier to backup critical configuration files or share media files between apps. Example, a syncthing shared dir became the jellyfin media source.

    And a convenient way to ‘reset’ a badly crashed app… or a lost password. Almost all the apps can rebuild itself if they lost their configuration files.