This post covered quite a bit of material, although we did not alter or add any more services. We added a couple extra methods to each service to help us test/debug issues with the applications, then we packaged the applications into JAR files. Next, we created Dockerfiles for each service that would allow Docker to create a container that copies and executes the service JAR.
We then tackled Docker Compose, which manages the services together using information we specify in the
docker-compose.yml file. We also covered the tricky "gotchas" with Docker networks and handled dynamic runtimes with environment variables and the
Finally, we saw how to run everything with a single
docker-compose command and how to test each of our endpoints to our applications still operate as expected. When we are done, we can run another
docker-compose command that stops the system and cleans out the setup, so we have a clean environment when we want to run again.
There is so much more we can explore with microservices, such as adding more data sources, additional services, asynchronous communication through messaging platforms, cloud deployments, and much more. I hope to catch you in future improvements on this project. Happy coding!