7 Deploying containerized applications

 

This chapter covers

  • Installing Docker on a virtual machine
  • Building and deploying Docker images to a VM
  • Using Docker Compose in production
  • Implementing a CI/CD pipeline
  • Discussing the limitations of Docker Compose

When we first deployed our applications, we had to install a number of system-level dependencies (e.g., Supervisor, Python, Node.js, etc.) and runtime-specific dependencies (e.g., pip install, npm install). This was true for our local system as well as our remote production virtual machines. These dependencies will always be needed by their very definition, but Docker helps us to manage these dependencies in a more effective way, especially in production.

In production, the primary system-level dependency we’ll need is a container runtime instead of individual application runtimes and their related system-level dependencies. Put another way, we only need to install Docker Engine and Docker Compose on our production virtual machine; we’ll never need to install Python, Node, Java, MySQL, PostgreSQL, Redis, Ruby, etc. This is the magic of containers: one runtime to rule them all.

Before we deploy our applications, let’s explore using Docker in production by deploying a simple and public containerized application: NGINX. We’ll start here as a proof of concept for deploying more complex applications such as our Python and Node.js applications.

7.1 Hello prod, it’s Docker

 
 

7.1.1 Provisioning a new virtual machine

 
 
 
 

7.1.2 Installing Docker on Ubuntu

 
 
 

7.1.3 Installing Docker Compose on Ubuntu

 
 

7.1.4 Deploying NGINX

 
 

7.2 Staging containers

 
 

7.2.1 Dockerfiles for multiple environments

 
 

7.2.2 Docker Compose for multiple environments

 
 

7.3 GitHub Actions to deploy production containers

 
 

7.3.1 Building and hosting a production container

 
 

7.3.2 Installing Docker and Docker Compose on a virtual machine with GitHub Actions

 
 

7.3.3 Using GitHub Actions to run Docker Compose in production

 
 
 

7.4 The limitations of using Docker Compose for production

 

7.4.1 Scaling containers with Docker Compose

 
 
 

7.5 Summary

 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage