Local commands cheatsheet¶
Project resource management¶
- Set up a project
divio project setup <slug>- Deploy Cloud server
divio project deploy(applies totestserver by default; optionally, specifylive)- Build local
webimage (e.g. after updatingrequirements.inor theDockerfile) docker-compose build web- Push/pull code
Use
gitcommands as appropriate.- Pull or push media or database
divio project pull mediaordivio project pull dbdivio project push mediaordivio project push dbThese commands apply to the
testserver by default; optionally, you can specifylive, e.g.divio project pull media live).- Manage environment variables
divio project env-vars- get custom valuesdivio project env-vars --all- get all valuesdivio project env-vars -s qa- get the values from the environment named qadivio project env-vars --set TEST myvalue- set the variableTESTtomyvalue
Running the local server¶
- Start a project
divio project up,docker-compose upordocker-compose run --rm --service-ports web- Stop a project
divio project stop, 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