Closed davidhoang101 closed 5 years ago
We don't do that because:
Also, without bind mounts Docker will create persistent volumes automatically (because they're specified in the image) and if you don't run docker-compose down
(use stop
instead) your data will remain with docker-compose up
. And even if you run down
the data is still will be available somewhere under /var/lib/docker
unless you run docker system prune --volumes
.
Why don't mount database volume by default? how can this retain changed things in database?