Installing Basket

Requirements

  • Docker
  • Docker-compose

You can install Docker CE for your platform at https://docker.com.

Installation

Get the code

git clone git@github.com:mozmeao/basket.git

Settings

Settings are injected into the Docker container environment via the .env file. You can get started by copying env-dist to .env and that will provide the basics you need to run the site and the tests.

Use Docker

The steps to get up and running are these:

$ # this pulls our latest builds from the docker hub.
$ # it's optional but will speed up your builds considerably.
$ docker-compose pull
$ # this starts the server and dependencies
$ docker-compose up web

If you’ve made changes to the Dockerfile or the requirements/*.txt files you’ll need to rebuild the image to run the app and tests:

$ docker-compose build web

Then to run the app you run the docker-compose up web command again, or for running tests against your local changes you run:

$ docker-compose run --rm test

We use pytest for running tests. So if you’d like to craft your own pytest command to run individual test files or something you can do so by passing in a command to the above:

$ docker-compose run --rm test py.test basket/news/tests/test_views.py

And if you need to debug a running container, you can open another terminal to your basket code and run the following:

$ docker-compose exec web bash
$ # or
$ docker-compose exec web python manage.py shell