Configuring Orchestration and Containers

Discuss the importance of orchestrating application development environments with container technology and creating Docker images for microservices.

We’re already orchestrating components of the application using container technology. The docker-compose.yml file that we’ve explored in previous chapters defines the supporting containers we need and their configuration. When we execute docker-compose with this file, we’re orchestrating the dependency resources by spinning up a specific configuration of containers in Docker.

The next step is to add the MTAEDA microservices to this orchestration definition so we can develop code efficiently and consistently.

Everything as Code (EaC)

For a moment, let’s validate why we want to continue with an orchestration approach to support the EDA development. With knowing at least the basics of DevOps (the practice, not the Microsoft service), we might have also heard of or worked with GitOps. At the heart of both practices, we’ll simply find code to describe every element of a running workload.

That is exactly what we’re going to do for this application development environment.

As developers, when we clone the application code, we want to ensure all configurations we need are in that same code base. As an operations team, we want to make sure we can deliver the environment that a developer expects for the application to function and perform successfully. The quality of the configuration code becomes as important as the actual application code itself.

If everything about the application, including the infrastructure requirements, is defined in code, we benefit in the following ways:

  • Faster environment configuration

  • Higher reliability

  • Consistent testing

  • Transparency of dependencies

  • Easier portability

For this course, we’ll focus on the orchestration of the development environment so we can leverage the faster environment configuration. We should be able to efficiently start all application components while supporting continuous changes and debugging.

Creating container images

We’ll create a configuration file that describes how a container should host the application code for the Producer and Consumer services. To achieve this, we’ll create a Dockerfile for each service and use the Docker command-line interface to build and then launch these images.

Fortunately, Visual Studio can take care of most of this for us.

From the context menu on the consumer project, select “Add...” and then select the “Docker Support...” option:

Get hands-on with 1200+ tech skills courses.