Divio’s local commands cheatsheet#
Application resource management#
Set up an application:
divio app setup <slug>
Deploy Cloud server:
divio app deploy
Or by specifying any other environment such as live
.
divio app deploy live
Build local web image:
e.g. after updating requirements.in
or the Dockerfile
.
docker-compose build web
Push/pull code:
Use git
commands as appropriate.
Pull or push media or database:
divio app pull media
divio app push media
divio app pull db
divio app push db
Or by specifying any other environment such as live
.
divio app pull media live
List custom environment variables:
divio app environment-variables list
Or by specifying any other environment such as live
or even all
environments using the --all-envs
flag.
divio app environment-variables list -e live
divio app environment-variables list --all-envs
Get a specific custom environment variable:
divio app environment-variables get <environment_variable_name>
Or by specifying any other environment such as live
or even all
occurrences of this environment variable across all environments using the
--all-envs
flag.
divio app environment-variables get <environment_variable_name> -e live
divio app environment-variables get <environment_variable_name> --all-envs
List deployments:
divio app deployments list
Or by specifying any other environment such as live
or even all
environments using the --all-envs
flag.
divio app deployments list -e live
divio app deployments list --all-envs
Get a specific deployment:
divio app deployments get <deployment_uuid>
Get an environment variable registered for a specific deployment:
divio app deployments get-var <deployment_uuid> <environment_variable_name>
Running the local server#
Start an application:
divio app up
You can also use equivalent docker commands such as:
docker-compose up
docker-compose run --rm --service-ports web
Stop an application:
divio app down
Working inside the containerised environment#
Run a specific command inside the web container:
docker-compose run --rm web <command>
For example,
docker-compose run --rm web python manage.py shell
Run a specific command inside the web container, exposing the ports listed in the Dockerfile:
docker-compose run --rm --service-ports web <command>
Docker management#
List running containers:
docker ps
List all containers:
docker ps -a
List images:
docker image ls
Remove all stopped containers:
docker container prune
Remove all unused containers and images:
docker system prune