Junior — Middle
Explain what Docker Compose is and what role it plays in container management?
sobes.tech AI
Answer from AI
Docker Compose is a tool for defining and running multi-container Docker applications. Using the docker-compose.yml file, you can describe the configuration of multiple containers, their networks, volumes, and dependencies.
The role of Docker Compose in container management:
- Allows running complex applications composed of multiple services with a single command.
- Simplifies the setup and scaling of services.
- Eases management of configurations and development environments.
Example of a simple docker-compose.yml:
version: '3'
services:
web:
image: nginx
ports:
- "80:80"
db:
image: postgres
environment:
POSTGRES_PASSWORD: example