Building and running a web application in Docker
In this section, we will build a Docker container image that packages a Python web application. This container image will include the web application and all its dependencies so that it can be run on a machine that has the Docker daemon installed.
To follow along with this example, make sure that you have the code for the book (from https://github.com/PacktPublishing/Windows-Subsystem-for-Linux-2-WSL-2-Tips-Tricks-and-Techniques) cloned in a Linux distro and then open a terminal and navigate to the chapter-07/01-docker-web-app
folder, which contains the sample application we will use here. Check the README.md
file for instructions on installing the dependencies needed to run the application.
The sample application is built on the Flask web framework for Python (https://github.com/pallets/flask) and uses the Gunicorn HTTP server to host the application (https://gunicorn.org/).
To keep the focus of the chapter on Docker containers...