Answer the question
In order to leave comments, you need to log in
What if multiple docker-compose depend on one mysql?
Couldn't have phrased the question better.
In general, this is the situation:
there is a web application that uses nginx + php + mysql,
there are some services in the form of binaries that also use the same mysql (data),
respectively, these are 2 different docker-composes that should work autonomously from each other.
There are 3 options in my head:
1. from the DC (docker-compose) of services, refer to a muscle that is on the web, but then the DC of services loses autonomy;
2. add another container with a muscle to the service DC, in which volume with the same data as in the web will be connected - it seems to be better, but 2 muscle instances are launched, which is also not very good. And if in the future there will be more redis, rabbitmq, etc...
3. In the form of a separate recreation center, but again, problems of autonomy.
Nothing more came up. Has anyone else been in a similar situation and know how it would be better?
PS I'm friends with docker recently :)
Answer the question
In order to leave comments, you need to log in
> there is a web application which uses nginx+php+mysql,
All on separate docker'am.
> there are some services in the form of binaries that also use the same mysql (data)
Also separate docker. Calling the correct mysql-docker port.
docker-compose is just for ease of setting up multiple docker
PS Option with two mysql on shared data folder - won't work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question