OnCallReady

Commands

docker-compose - Define and run multi-container applications

docker compose [-f FILE] [-p NAME] [--profile P] COMMAND

Options you will use

up [-d] [--build] [--wait] [SERVICE...]
Create networks and volumes, build/pull images, and start containers in depends_on order.
down [-v] [--rmi all|local]
Stop and remove containers and networks. Volumes only with -v.
ps [-a] / logs [-f] [--tail N] [SERVICE]
Status and logs, prefixed by service.
exec SERVICE CMD / run --rm SERVICE CMD
Run in an existing container / in a new one-off container.
config [--services|--volumes|--profiles]
The fully interpolated project. The fastest way to see what .env really produced.
build / pull / stop / start / restart
The usual lifecycle.
-f, --file FILE
Compose configuration files (repeatable; later files override earlier ones). Default compose.yaml.
-p, --project-name NAME
Project name (default: the directory name). Prefixes containers, networks and volumes.
--profile PROFILE
Enable a profile: services with profiles: [PROFILE] start only when it is on.
--env-file FILE
Specify an alternate environment file (default .env, used for ${VAR} interpolation).
--project-directory DIR
Specify an alternate working directory (default: the directory of the first compose file).
--ansi STRING
Control when to print ANSI control characters: never, always, auto.
--progress STRING
Set type of progress output: auto, tty, plain, json, quiet.
--dry-run
Execute command in dry run mode: show what would happen.
--parallel INT
Control max parallelism, -1 for unlimited.

Examples

$ docker compose up -d

start the project in the background

$ docker compose config

see the file after ${VAR} interpolation

$ docker compose --profile debug up -d

include services in the debug profile

Gotchas

Try docker-compose in a real terminal Free, in your browser - a real Ubuntu terminal to try it in, with missions that check your work.