Docker-compose
Last updated
Last updated
Docker Compose is a tool that makes it easier to create and run multi-container applications.
It automates the process of managing several Docker containers simultaneously, such as a website frontend, API, and database service.
Docker Compose allows you to define your application’s containers as code inside a YAML file you can commit to your source repository.
Once you’ve created your file (normally named docker-compose.yml), you can start all your containers (called “services”) with a single Compose command.
Compared with manually starting and linking containers, Compose is quicker, easier, and more repeatable.
Compose automatically creates a Docker network for your project, ensuring your containers can communicate with each other.
It also manages your Docker storage volumes, automatically reattaching them after a service is restarted or replaced.
Most real-world applications have several services with dependency relationships—for example, your app may run in one container, but depend on a database server that’s deployed adjacently in another container.
Moreover, services usually need to be configured with storage volumes, environment variables, port bindings, and other settings before they can be deployed.
This improves developer ergonomics, supports reuse of the stack in multiple environments, and helps prevent accidental misconfiguration.
Docker is a containerization engine that provides a CLI for building, running, and managing individual containers on your host.
Compose is a tool that expands Docker with support for multi-container management. It supports “stacks” of containers that are declaratively defined in project-level config files.
Fast and easy configuration with YAML scripts
Single host deployment
Increased productivity
Security with isolated containers