Understanding Docker Volumes vs. Bind Mounts
Why do containers eat your data on updates? Bind mounts vs volumes explained, the path syntax that matters, and the :ro trick to protect your media.
The #1 Mistake Beginners Make
Docker containers are disposable. If you update an application, the old container is deleted and a new one is created. If you haven’t mapped your data to your host hard drives, all your data is deleted with it.
Bind Mounts (The Best Way for Media)
A bind mount maps a physical folder on your hard drive to a folder inside the container.
Syntax: HOST_PATH : CONTAINER_PATH
In my server, I map my 1TB HDD directly to the Immich container, and my 2TB HDD directly to Jellyfin.
volumes: - /mnt/2TB_drive/movies:/data/movies:roThe :ro at the end means “Read-Only”. Even if Jellyfin glitches, it physically cannot delete my movie files.
Note
Folders that start with ./ in a Compose file (like ./jellyfin-config) are relative bind mounts. My Docker Compose template uses that pattern for every config folder.