#27 Docker Compose
Table of contents
No headings in the article.
Lecture-15 Docker Compose Part-1
Compose is a tool for defining and running multi-container Docker applications. With Compose, you use a YAML file to configure your application’s services. Then, with a single command, you create and start all the services from your configuration.
Compose works in all environments: production, staging, development, testing, as well as CI workflows. It also has commands for managing the whole lifecycle of your application:
Start, stop, and rebuild services
View the status of running services
Stream the log output of running services
Run a one-off command on a service
The key features of Compose that make it effective are:
Supports variables and moving a composition between environments
Docker composes installation:
Creating multiple containers in a single yaml file by using docker-compose
Lecture-16 Docker Compose Part-2
Port mapping:
Creating replicas of containers.
scale-up:
scale down:
Only it will download
rm - will remove the stopped container.
If multiple projects are there you need to mention the file name.
YAML to JSON:
Lecture-17 Docker Compose Part-3
docker-compose --help
The difference between build will run the particular parameter and up will run all the parameters which are mentioned in the file.
docker-compose config: will display the content of the file