Docker Compose Reference
Compose File Version 3 Cheat Sheet
Please remember to check your Docker version along with the file version if you run into any
issues. You can find more here:
https://docs.docker.com/compose/compose-file/compose-versioning/
The following commands can be found at https://docs.docker.com/compose/reference/
A list of core commands include the following:
Docker-compose up
#Builds, (re)creates, starts, and attaches to containers for a service.
Docker-compose start
Starts existing containers for a service.
Docker-compose stop
#Stops running containers without removing them. They can be started again with docker-compose
start.
Docker-compose ps
#This command will list containers
#Docker-compose down
#Stops containers and removes containers, networks, volumes, and images created by up.
For a Compose file, we are building a YML or YAML (.yml or .yaml both work) to define our services,
networks, and volumes. The default path for a Compose file is ./docker-compose.yml.
                                        Version 3 Example
For examples of version 3 please see:
https://docs.docker.com/compose/compose-file/#compose-file-structure-and-examples
Docker Compose File Reference: https://docs.docker.com/compose/
A compose YML file will look similar to the following as an example:
                                     Compose File elements
Also, when building a compose file the following reference can be extremely helpful:
https://docs.docker.com/compose/compose-file/#expose
You can examine the parameters for specific builds, such as:
Secrets Configuration Reference
Networks
Restart Policy