Docker Compose with NGINX
In our previous recipes, we deployed Docker containers in a singular fashion. While this is okay for smaller projects and testing, for production environments, ideally, we want this to be as repeatable as possible. This is where Docker Compose comes into the picture. Docker Compose is a tool that allows you to define multicontainer Docker applications for ease of management and ease of deployment. It does this via a single configuration file, which defines both the containers to deploy as well as the networking.
Getting ready
Docker Compose is installed by default for all modern Docker installations. We'll take our Redmine deployment and convert it back into a one-command deployment process again.
How to do it...
To get started, we need to create a docker-compose.yml
file. This is in YAML format, which is a simple text-based language with a strong focus on readability. Here's what our docker-compose.yml
file looks like:
version: '3' networks: webnet: services...