I'm trying to set up an ebook manager app on my NAS, and I need to figure out the best way to import ebooks stored in a different folder on the same NAS. Would it be better to create a volume, which I understand is managed by Docker, or should I go with a bind mount that points to my own folder? Any advice would be appreciated!
2 Answers
For your scenario, bind mount is indeed the best choice. Just a heads-up about permissions: if your container runs under a different user, be ready to change ownership of the folder or set some environment variables to manage user IDs correctly. It's a common issue I've faced with NAS setups, but nothing you can't handle!
You've nailed the difference! Basically, if you want to access those ebooks stored on your NAS directly, go for a bind mount. This way, you can keep your existing directory structure and manage files outside Docker. A bind mount is super handy for your situation since you’re dealing with existing files that you might want to access in multiple ways. You could set it up like this:
volumes:
- /mnt/nas/books:/books
This lets Docker point right at your folder.
Exactly! A bind mount is definitely the way to go for your ebook manager. Just keep in mind to check the permissions, especially if the container runs as a different user. You may need to configure that to avoid any headaches with access.
Right! Just remember to verify those permission settings so everything works smoothly!

Thanks for the tip! I'll definitely keep an eye on the permissions.