Introduction
Sometimes your app needs to save data that stays safe even if the app stops or restarts. Volumes in Docker Compose help you keep this data outside the app container so it doesn't get lost.
When you want to save database files so they are not deleted when the container stops.
When you need to share files between your computer and the app running inside a container.
When you want to keep logs or uploads safe even if you update or remove the app container.
When multiple containers need to access the same files or data.
When you want to separate app code from data for easier backups and updates.