I’m hosting a few services using docker. For something like an openstreetmap tileserver, I’d like it to remain on my SSD because high speed improves performance, and the directory is unlikely to grow and fill the drive.
For other services like NextCloud, speed isn’t as important as storage size, so I might want it on a larger HDD raid.
I know it’s trivial to move the volumes directory to wherever, but can I move some volumes to one directory and some volumes to another?
Same, I don’t let Docker manage volumes for anything. If I need it to be persistent I bind mount it to a subdirectory of the container itself. It makes backups so much easier as well since you can just stop all containers, backup everything in ~/docker or wherever you put all of your compose files and volumes, and then restart them all.
It also means you can go hog wild with
docker system prune -af --volumes
and there’s no risk of losing any of your data.Yes that’s what I do too!
Overnight cron to stop containers, run borgmatic, then start the containers again.