Applying multi-container deployment with Docker Compose
In addition to building separate containers for each application component, we can also build multiple containers at once for the application components. This simplifies deployment and saves us time.
To containerize our microservices application, we distinguish the following components as potential containers:
Figure 8.4 – Multi-container microservices application
This way, we’ll have isolated containers for:
- The Django subscription app running at port
8000
. - Redis as the message broker for Celery.
- The Celery workers for matching an address and sending a confirmation email.
- The RESTful API running at port
7000
.
We could also run MongoDB in a container, but since we use the cloud version, we have already isolated the database.
We could create these containers individually. But with the Docker compose facility, we can create the containers and necessary...