Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
First you need to understand that in order for the database not to disappear, it must be saved outside the container. Because the container is ephemeral, and its FS may disappear when the container is deleted. There are two ways to do this: volume and bind mount. The first saves data in a named or unnamed volume in the /var/lib/docker/volumes directory and there is a risk that it will be accidentally deleted (for example, with docker-compose down -v ). The second method allows you to store data outside the container in the file system of the host machine. It's more reliable.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question