Composing the application and database servers
The next step is to create the configuration file that specifies how the SportsStore and Postgres images will be used to create containers. This step is dependent on how the containers are going to be deployed, for which there are many options. All of the major cloud platforms provide support for using containers, and the configuration will have to be adapted to the needs and features of the target platform.
For this chapter, I am going to use Docker Compose, which is the built-in tool provided with Docker Desktop. You may not use Docker Compose for your projects, but it has the same core features that you will encounter regardless of how you deploy, and it makes it easy to combine and test containers to create a complete application. Add a file named docker-compose.yml
to the sportsstore
folder with the content shown in Listing 21.20.
Listing 21.20: The contents of the docker-compose.yml file in the sportsstore folder
version...