Docker Compose¶
Docker Compose is a tool used to define and run multi-container Docker applications.^[600-developer__docker__docker-compose__docker-compose-01.md] It allows users to launch multiple Docker images simultaneously using a single configuration file, typically named docker-compose.yml.^[600-developer__docker__docker-compose__docker-compose-01.md]
Configuration¶
The core functionality revolves around the docker-compose.yml file, where services are defined^[600-developer__docker__docker-compose__docker-compose-01.md]. A typical configuration includes a version field and a services section specifying container images, environment variables, restart policies, and port mappings^[600-developer__docker__docker-compose__docker-compose-01.md].
For example, a stack consisting of a MySQL database and an Adminer interface can be defined with specific images (e.g., mysql:5.7), credentials, and port bindings (e.g., 8888:8080)^[600-developer__docker__docker-compose__docker-compose-01.md].
Usage¶
To launch the application, the command docker-compose up is used^[600-developer__docker__docker-compose__docker-compose-01.md]. Containers can be run in the background by appending the -d flag^[600-developer__docker__docker-compose__docker-compose-01.md].
Installation¶
Docker Compose can be installed via yum by enabling epel-release and using pip^[600-developer__docker__docker-compose__docker-compose-01.md], or directly via curl by downloading the binary from the official GitHub repository to /usr/local/bin/^[600-developer__docker__docker-compose__docker-compose-01.md].
Sources¶
600-developer__docker__docker-compose__docker-compose-01.md