To bring the demo environment online, open a Terminal window, and change to the directory where you restored the source code for the book. To build the new Docker image to be used to test examples from Chapter 3, Essential MongoDB Administration Techniques, to Chapter 12, Developing in a Secured Environment, run this command:
docker-compose build
To run the image, simply issue this command (the -d option causes the container to run in the background):
docker-compose up -d
After that, you can issue this command to open up a command shell inside the running container:
docker exec -it learn-mongo-server-1 /bin/bash
You should see a /repo directory that contains all the source code from the repository. If you then change to the /repo/chapters/02 directory, you can run the Python test program that confirms whether or not a connection to MongoDB is successful. Here is a screenshot of what you might see: