This guide explains how to run the project with Docker. It is written for people who are new to Docker.
- Docker runs your app and its dependencies (PostgreSQL, Redis, Selenium) in isolated containers.
- Docker Compose starts multiple containers together and wires them (e.g. app → database).
- You do not need to install Python or PostgreSQL on your machine to run the app with Docker.
-
Install Docker Desktop (includes Docker and Docker Compose):
- Mac/Windows: Docker Desktop
- Linux: Install Docker Engine and Docker Compose plugin (see Docker docs for your distro).
-
Check that it works. Open a terminal and run:
docker --version docker compose version
You should see version numbers. If you get “command not found,” Docker is not on your PATH or not installed.
-
Go to the project folder:
cd /path/to/boost-data-collector -
Create a
.envfile (Docker Compose and Django read this):cp .env.example .env
Then edit
.envand set at least:-
Database: Docker Compose will start PostgreSQL. You can use these defaults in
.env(they matchdocker-compose.yml):POSTGRES_USER=boost POSTGRES_PASSWORD=boost POSTGRES_DB=boost_dashboard
And set Django’s database URL so it points at the
dbcontainer:DATABASE_URL=postgres://boost:boost@db:5432/boost_dashboard
-
Django: Set a strong
SECRET_KEY(and optionallyDEBUG=Truefor local use). -
Optional: Add any API keys you need (e.g.
GITHUB_TOKEN,SLACK_BOT_TOKEN) as in.env.example.
Compose will pass
DATABASE_URL,CELERY_BROKER_URL, etc. to the app; thedbandredishostnames are the service names indocker-compose.yml. -
From the project root:
docker compose buildThis builds the app image (installs Python and dependencies). Do this once, or after changing requirements.txt or the Dockerfile.
Then start all services:
docker compose up -dOn macOS (especially with the project on an external volume): To avoid Docker build errors caused by macOS ._* files, use make up instead (see below). It automatically cleans those files before starting Compose.
up= start the containers.-d= “detached” (run in the background so you get your terminal back).
Containers that will run:
| Service | Role | Port / note |
|---|---|---|
| db | PostgreSQL | Internal only |
| redis | Redis (Celery) | Internal only |
| selenium | Chrome (Selenium) | http://localhost:4444 (for cppa_slack_transcript_tracker) |
| web | Django (gunicorn) | http://localhost:8000 |
| celery_worker | Celery worker | Runs tasks |
| celery_beat | Celery beat | Schedules daily job (schedule persisted in volume) |
The database is empty at first. Run Django migrations inside the web container:
docker compose run --rm web python manage.py migraterun= run a one-off command in a service.--rm= remove the temporary container when the command finishes.web= use the app image and env (DB connection, etc.).
After this, the app is ready to use.
In your browser go to:
You should see the Django app (or admin if you configured it).
The project includes a Makefile. From the project root, run make help to see all available commands:
make build # Build (or rebuild) all images
make up # Clean macOS files, then start all services (detached)
make down # Stop and remove containers (volumes kept)
make stop # Pause all containers (fast restart with: make start)
make start # Resume paused containers
make restart # Stop then start all containers
make reset # !! Remove containers AND volumes (wipes DB + data)
make ps # Show running containers
make logs # Follow logs for all services
make logs-web # Follow web logs only
make logs-worker # Follow Celery worker logs
make logs-beat # Follow Celery beat logs
make migrate # Apply database migrations
make makemigrations # Create new migration files
make superuser # Create a Django superuser
make shell # Open Django shell inside the web container
make bash # Open a bash shell inside the web container
make collectstatic # Collect static files
make test # Run full pytest suite
make test-fast # Run tests, stop on first failure
make clean-mac # Remove macOS ._* resource-fork files
make clean-pyc # Remove compiled Python (.pyc / __pycache__)
make clean # Run both clean-mac and clean-pyc
The make up / make build targets always run clean-mac first, so you never hit the macOS xattr build error on external volumes.
-
See running containers:
docker compose ps
-
View logs (all services):
docker compose logs -f
Logs for one service only:
docker compose logs -f web docker compose logs -f celery_worker
-
Stop everything:
docker compose down
Data in the
postgres_data,workspace_data,logs_data, andcelerybeat_datavolumes is kept. -
Stop and remove volumes (deletes database and workspace data):
docker compose down -v
-
Run a one-off command (e.g. Django management command):
docker compose run --rm web python manage.py run_scheduled_collectors --schedule daily --group github docker compose run --rm web python manage.py createsuperuser
-
Rebuild after code or dependency changes:
docker compose build docker compose up -d
-
“Cannot connect to database” / “connection refused” Wait a few seconds after
docker compose up -dand run migrations again. Thewebservice waits fordbto be healthy before starting. -
Port 8000 already in use Change the host port in
docker-compose.ymlunderweb→ports, e.g."9000:8000", then use http://localhost:9000. -
Changes in code not visible Rebuild:
docker compose build webthendocker compose up -d. -
Need to see what’s inside a container
docker compose exec web bashThen you can run
python manage.py shell,ls, etc. Exit withexit.
- Install Docker (Desktop or Engine + Compose).
- Copy
.env.exampleto.envand setDATABASE_URL(and optional secrets). - Run
docker compose buildthendocker compose up -d. - Run
docker compose run --rm web python manage.py migrate. - Open http://localhost:8000.
For more on Docker, see Docker’s getting-started guide.