Divio’s local commands cheatsheet#
Application resource management#
- Set up an application
divio app setup <slug>
- Deploy Cloud server
divio app deploy
(applies totest
server by default; optionally, specifylive
)- Build local
web
image (e.g. after updatingrequirements.in
or theDockerfile
) docker-compose build web
- Push/pull code
Use
git
commands as appropriate.- Pull or push media or database
divio app pull media
ordivio app pull db
divio app push media
ordivio app push db
These commands apply to the
test
server by default; optionally, you can specifylive
, e.g.divio app pull media live
).- Manage environment variables
divio app env-vars
- get custom valuesdivio app env-vars --all
- get all valuesdivio app env-vars -s qa
- get the values from the environment named qadivio app env-vars --set TEST myvalue
- set the variableTEST
tomyvalue
Running the local server#
- Start an application
divio app up
,docker-compose up
ordocker-compose run --rm --service-ports web
- Stop an application
divio app down
, or exit the command with Control-C.
Working inside the containerised environment#
- Run a specific command inside the web container
docker-compose run --rm web <command>
, for exampledocker-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