This repo shows an example of using volumes to speed up Python development in Docker.
Check out the full post for information on how the repo works, or just try it out!
This example was originally created as an application for testing Blimp. Blimp is a development environment that runs in the cloud, but has the exact same workflow and config as Docker Compose.
This repo works with docker-compose up as well without any modifications.
git clone https://github.com/kelda/django-polls
cd django-pollscurl -fsSL 'https://kelda.io/get-blimp.sh' | shOr, via Homebrew:
brew install kelda/tools/blimpblimp loginblimp upThis boots the docker-compose.yml, and sets up the declared volumes and tunnels.
If you're using Docker Compose, run docker-compose up instead.
- Open
localhost:8000, and vote a couple times. Note that each vote counts twice. - Edit
polls/views.pyand fix the bug on line 51 by changing it toselected_choice.votes += 1. - Refresh
localhost:8000and note how you can now see the votes for each option.
- Let us know what you thought to help us continue improving the development experience for Docker.
- Check out the full blog post on speeding up python development with volumes.
- The app is adapted from https://docs.djangoproject.com/en/3.0/intro/tutorial01/