Preparing the database containers to work together

For our project to run as a Docker container and apply the new databases that meet CQRS, we have to make some changes to the docker-compose.yml news of our projects. Again, I'll apply the changes only to famous_news_service. However, the changes must be applied to all News microservices.

First, let's create the containers for the database. We know that every database in each news container has a Dockerfile, and that's exactly what we'll use. The first container we will create is to service the application's QueryStack. Notice that we will do the build pointing to the internal Dockerfile of the famous_news_service microservice:

querydb_famous: image: querydb_famous build: ./FamousNewsService/query_db/ ...

Get Microservice Patterns and Best Practices now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.