Reference


Generate Django secret key:

python -c 'import random; print "".join([random.choice("abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)") for i in range(50)])'

Build image:

$ docker-compose build
$ docker-compose build --no-cache   # build without cache

See processes:

$ docker-compose ps    # docker-compose processes
$ docker ps -a        # docker processes
$ docker stats <container name>   # see live docker container metrics

Remove all docker containers:

$ docker rm $(docker ps -a -q)

Remove all docker images:

$ docker rmi $(docker images -q)

List dangling volumes:

$ docker volume ls -qf dangling=true

Remove all dangling volumes:

docker volume ls -qf dangling=true | xargs -r docker volume rm

Remove all containers, images, and networks created by the docker-compose up command:

$ docker-compose -f docker-compose.yml down --rmi all

Invoke task list:

  • clean
    • Clean’s *.pyc files
  • build
    • #TODO
  • dev_start
    • Bring the containers up with the dev compose file in detached mode
  • dev_start_build
    • Builds and brings the containers up with the dev compose file in detached mode
  • dev_start_show
    • Bring the containers up in the shell with the dev compose file
  • dev_stop
    • Stops all containers
  • prod_start
    • Bring up containers in the prod environment in detached mode
  • prod_start_build
    • Build and brings the containers up in the prod environment in detached mode
  • prod_start_show
    • Bring the containers up in the shell
  • prod_stop
    • Bring down the containers
  • start_shell
  • start_psql
  • start_bash
  • migrate
    • Run migrate on the web container
  • backup_db
    • Backup current postgresql database
  • list_backups
    • Lists all postgresql backups
  • rm_all_containers
    • Restart fresh
  • rm_all_images
    • Remove all trash images