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.