In this chapter, the sample solution is in the ch10-nerd-dinner folder. It's the modernized NerdDinner application that has evolved over the previous chapters. There's a Dockerfile for every component. This uses a multi-stage build, and a set of Docker Compose files for building and running the application.
The folder structure here is worth looking at to see how distributed applications are usually arranged—the src folder contains all the application and database source code, the docker folder contains all the Dockerfiles, and the compose folder contains all the Compose files.
I've created a freestyle job in Jenkins to run the build, and configured Git for source code management. It's simple to configure Git—I'm using the same repository URL that I use for the Git repository on my laptop, and I've selected the Gogs credentials so that Jenkins can access them:
Jenkins supports multiple types of build triggers. In this case, I'm going to poll the Git server on a set schedule. I'm using H/5 * * * * as the schedule frequency, which means Jenkins will check the repository every five minutes. If there are any new commits since the last build, Jenkins will run the job.
That's all the job configuration I need, and all the build steps will now run using Docker containers.