I have a question:
For example i have two applications A and B. Both projects have their own docker-compose.yml configurations. Both have such containers like nginx and mysql. So, could i reuse mysql/nginx containers in both docker-compose configs without recreating containers for each project (i need to use SAME containers with same data)?
Hey there, in case you deploy it as docker services (using docker stack deploy), you could define an external network.
By doing so, your DB container could be attached to multiple external networks. One network for service A and one network for service B.
For this you might even use three dockerfiles: db.yml, service1.yml and service2.yml.
If service 1 and 2 are similar and only differ in the environment variables, you might even use different env-files.