Using Docker for Development¶
Using Docker to build software allows you to run and test code without having to worry about external dependencies such as cache servers and databases.
The following setup is only meant for local development. See Docker for production use of Docker.
You will need to install Docker and docker-compose before performing the following steps.
Our configuration exposes PostgreSQL, Redis and Elasticsearch ports. If you have problems running this docker file because of port conflicts, you can remove ‘ports’ section from docker-compose.yml
$ npm install
Prepare static assets
$ npm run build-assets
$ npm run build-emails
Build the containers using
$ docker-compose build
Prepare the database
$ docker-compose run web python manage.py migrate $ docker-compose run web python manage.py collectstatic $ docker-compose run web python manage.py populatedb --createsuperuser
--createsuperuserswitch creates an admin account for
email@example.com the password set to
Run the containers
$ docker-compose up
By default, the application is started in debug mode, will automatically reload code and is configured to listen on port