What is Docker Compose and when do you use it?easy
Answer
Docker Compose defines and runs multi-container applications with a YAML file. One command ( docker compose up ) starts all services with their networks, volumes, and dependencies.
Explanation
Common use: local development environments with a web server, database, and cache defined together. depends_on sets start order; healthcheck waits until a service is ready. In production, Kubernetes replaces Compose - Compose is not designed for production orchestration (no auto-scaling, rolling deploys, or self-healing). Compose v3 syntax is shared with Docker Swarm for simple production deployments.
Follow-upHow do you override Compose configuration for different environments?