I think of the following two methods:
Synchronize data files with the -v parameter
During the execution, the data file was not found and checked
postgresql.conf, said in
/var/lib/postgresql/9.5/mainBut the file size is very small, and my data is very large.
And I guess whether it is possible to do this and synchronize the data files directly to achieve data synchronization.
-p 5432To make Docker use the host database when adding, deleting, modifying and checking?
At the time of execution
-pParameter, an error was reported
5432Already occupied because my other programs are accessing the database.
What should I do to synchronize Docker’s data with the host data in real time?
Can’t two database instances use the same data file? I have never seen such a database before. ….
The second way is not understood ….
PS: If you really want to synchronize the host database with docker, you can form a cluster … This is the way I can think of. ….