Skip to content

Run locally using Docker compose

Nikita Shamaev edited this page Sep 15, 2022 · 5 revisions

Local Testing

If you want just to run all the things locally, you can use Docker-compose which will start all containers for you. This approach is similar to Production deployment using Dokku but not recommended for production.

Create .env file.

You can switch to PostgreSQL just by uncommenting it's DATABASE_URL and commenting SQLite variable.

cp .env_example .env

Docker-compose

To run all services (Django, Postgres, Redis, Celery) at once:

docker-compose up -d --build

Check status of the containers.

docker ps -a

It should look similar to this:

Try visit Django-admin panel.

Enter django shell:

docker exec -it dtb_django bash

Create superuser for Django admin panel

python manage.py createsuperuser

To see logs of the container:

docker logs -f dtb_django