Try Docker for yourself by checking out this repository!
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.


Try Docker for yourself by checking out this repository!

What to do:

  1. Download Docker
  2. Download Docker Compose (If not on a Mac)
  3. Fork this repo into your own GitHub space
  4. Clone this repo onto your own machine

Run the project (Lumos)

docker-compose up 

Notice how two services are created: db_1 and web_1. See that migrations run and the server starts.

Create a superuser

In a new tab, run:

docker-compose run web --rm ./ createsuperuser

Create sample data

Log into the admin at http://localhost:8000/admin/ and add some content.

Visit http://localhost:8000/spells/ to see a list of your data, and http://localhost:8000/spells/{pk}/ to see a detail view of your data.

More ideas


Add new features to the Spell model, or add a new model or app.


docker-compose run --rm web ./ makemigrations 

And then run

docker-compose run --rm web ./ migrate 

Django Shell (Apparate)

Hop into the shell with

docker-compose run --rm web ./ shell 

And experiment with poking around by importing a model and running queries on it.

Add a new requirement

Update your requirements file with something like requests or another library you love. Stop Docker, then restart with:

docker-compose up --build 

See your images (Imago Revelio)

docker images 

See your running containers (Continens Revelio)

docker container ls 


docker ps 

Add a volume for your data

It's helpful in development (and pretty necessary in production) to have your data persist across containers and across coding sessions. Read more about volumes in the docs.

To add a data volume to your project, make these changes to docker-compose.yml:

      - postgres_data:/var/lib/postgresql/data/



First add a volume element under your db service and name it postgres_data. Include the path to where your data will be stored in your container.

Then, add another element at the same level as services called volumes, and refer to your postgres_data volumes.

Now you won't need to recreate your superuser and test data every time you shut down your containers.

Stop for the day (Nox)

docker-compose down 

Enrichment exercises

  1. Build your image from scratch and give it a name
  2. "Exec" into the Docker container with docker exec --it
  3. Stop and restart just the web container
  4. Add a new service to docker-compose.yml; maybe Redis?
  5. Add tests and run them using docker-compose run commands


This repo uses the Git Commit Message StyleGuide.