Answer the question
In order to leave comments, you need to log in
Where is the data of a database running in a docker container stored?
I have not worked with containers yet, I am just studying the topic. I see that it is quite easy to deploy a container with a mongo (or any other database), and hook a running application to it.
The issue is that the container can be rebuilt, removed, restarted, etc. How to save data?
Answer the question
In order to leave comments, you need to log in
There are options with volume connection, network drives and other garbage, but Docker developers write in black and white
Don't use Docker for persistent storage
If the container was not created by a moron, then the data is stored in an external volume.
folder mounting
volumes:
- ./resource/sql:/tmp/sql
- ./resource/docker/mysql/data:/var/lib/mysql
- ./resource/docker/mysql/config:/etc/mysql/conf.d
- ./log/docker:/var/log/mysql
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question