Docker based microservices architecture


I have microservices-based project using Docker containers. Yii2 advanced application sits in one of this containers, MySQL - in another one, and there are a couple of other containers with services surrounded by nginx.

The question: Is there a way to separate Yii2 advanced applications(lets say there are 3 of them), which share common folder, into 3-4 Docker containers?

I see it like common/ + Yii2 sits in one container. It available to those 3 applications in another 3 separate containers.

Or, maybe, it’s better to run 3 basic applications in 3 separate containers, which share common/ from another container.

Or, maybe, it’s a dead end and better to use another framework for such a task? Which one is fit for it?

Why do you want to keep common in a container? That’s not an application, just pack of files so you should instead mount it to containers that need it.