How can I mirror data in one container to another?
2 answers
You need to set up standard replication between mysql containers.
You cannot use something like volume to share mysql data at the file level because mysql will most likely mess things up and mess up the data.
You can do replication as Master-Slave or Master-Master scheme (according to your needs).
Refer to the docs for details.
+1
source to share
I think @Robert is absolutely correct because you can probably start with a simple master-slave or master-master schema.
Since you mentioned Docker, I think the AutoPilot pattern is a good repository to run. They have a MySQL solution (replication, backup, failover, ...). You can find it here https://github.com/autopilotpattern/mysql
+1
source to share