Docker
/Intermediate
docker-compose.yml
Definition
The declarative YAML configuration file used by Docker Compose. It dictates exactly how the services, networks, and volumes should be built and interconnected.
Explain Like I'm New
The master blueprint for the entire application stack. It specifies that the Web service needs port 80, the Database service needs a volume, and that the Web service cannot start until the Database is fully booted.
Real World Example
A file that outlines: ```yaml services: db: image: postgres:15 api: build: . ports: ["3000:3000"] depends_on: ["db"] ```
Common Use Cases
- •Infrastructure as Code
- •Onboarding developers
Interview Questions
basic
- What is the default filename Docker Compose looks for when you run `docker-compose up`?
intermediate
- What does the `depends_on` keyword actually do in a compose file?