Skip to content

Instantly share code, notes, and snippets.

@jeffstephens
Created October 22, 2019 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeffstephens/6ebce4bd3975bf124a52f2ea3ac01978 to your computer and use it in GitHub Desktop.
Save jeffstephens/6ebce4bd3975bf124a52f2ea3ac01978 to your computer and use it in GitHub Desktop.
Handy docker-compose commands

docker-compose cheat sheet

Start up services in daemon (background) mode

docker-compose up -d

Start up services in daemon (background) mode after rebuilding

docker-compose up -d --build

Tail the logs of a single service

docker-compose tail -f app

Get an interactive shell in a service's container

docker-compose exec app /bin/sh

Stop containers while preserving their data

docker-compose down

Tear down all containers and delete their data

docker-compose down -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment