October 2018
Intermediate to advanced
332 pages
8h 9m
English
Docker Compose is a tool for defining our multi-layer application. This is where we define all the services needed to run our application, configure them, and link them together.
Docker Compose is based on YAML files, which is where all the definition happens, so let's dive right into it and take a look at the deploy/docker/docker-compose.yaml file:
version: '3'services: db: image: mysql:5.7 env_file: - prod.env rmq: image: rabbitmq:3-management env_file: - prod.env ports: - 15672:15672 redis: image: redis worker: image: myblog_worker:latest depends_on: - db - rmq env_file: - prod.env frontend: image: myblog depends_on: - db - rmq env_file: - prod.env restart: always ports: - 80:80
In Docker Compose, we have defined the following ...