Build, Release, and Distribute Your Python App with Docker
260 pages
10 hours of reading
Focusing on containerization, this second edition enhances the original by revising all chapters and updating commands, code, and examples to align with the latest Docker developments. It features a new chapter dedicated to production deployment, clarifying key concepts such as Dockerfile and Docker volumes. Additionally, readers will engage in a practical project, building a Telegram bot using Python, providing hands-on experience alongside theoretical knowledge.
Chapter 1: Introduction to Containerization & Docker Chapter Goal: Brief
introduction to containerization, how they compare to virtual machines, Docker
and getting the reader ready for the content of the book Sub -Topics 1. What
are containers 2. Containers vs Virtual machines 3. Introduction to Docker 4.
Installing Docker 5. Introduction to the Project Chapter 2: Docker 101 Chapter
Goal: Getting started with Docker, running a sample container Sub - Topics: 1.
Checking if Docker is ready 2. Docker client 3. Running/stopping/ connecting a
Docker container 4. Dockerfile brief 5. Practical: Running a simple container,
hands-on some common Docker commands Chapter 3: Building the Python App
Chapter Goal: Getting to understand the project, APIs involved, pre-requisites
Sub - Topics: 1. Project description (delivering latest content from Reddit to
Telegram messenger) 2. Setting up the Python workspace (installing the
required libraries, setting up virtualenv) 3. Creating a Telegram bot 4.
Running the Python application and confirming bot works Chapter 4:
Understanding Dockerfile Chapter Goal: Getting to know Dockerfile, the
different constructs and concepts Sub - Topics: Dockerfile, dockerignore Base
image & using them with from ... RUN/CMD/Environment variables Practical:
Modifying sample Dockerfile to run our Project Chapter 5: Understanding Docker
Volumes Chapter Goal: Containers are meant for stateless applications. Chapter
explains steps needed to persist data Sub - Topics: Problem of stateful
applications in containers Docker volumes Practical: Show how data in
containers is lost when container is killed and how Docker volumes avoid this
Practical: Modifying our project Dockerfile to add Docker volumes Chapter 6:
Docker Networking Chapter Goal: Overview of Docker networking, linking
containers Sub - Topics: Docker bridged network User defined networks
Practical: Create a Database container and link it with our project
application server container Chapter 7: Multi Container Applications with
Docker Compose Chapter Goal: Building multi-container applications with Docker
compose Sub - Topics: DockerCompose file reference Linking/establishing
dependencies across containers Environment variables across linked containers
Practical: Moving our project from separate linked containers to Docker
Compose project