Docker Compose Flashcards
What is Docker Compose?
Docker Compose is a tool for orchestrating containers locally. It should not be used for production.
What is a compose.yaml
file?
A compose.yaml
file is a set of instructions for building and executing container services
By default Compose sets up a single network for your app. Each container for a service joins the default network and is both reachable by other containers on that network, and discoverable by the service’s name.
Docker compose supports variables in the compose file, allowing you to customize your composition for different environments
Which has the highest precedence when defining environment variables: compose.yaml
or Dockerfile
?
compose.yaml
has the highest precedence. This means, configuration specified in compose.yaml
will override configuration in Dockerfile
. For more details, review: https://docs.docker.com/compose/environment-variables/envvars-precedence/
The compose.yaml
file adds the service names as hostname aliases