Bifrost synchronises patient data between the SyNCH CCMDD APIs and us.
- Python 3.10 or newer
uv
- Apply migrations:
uv run ./manage.py migrate- Create an admin user if you want to use the Django admin:
uv run ./manage.py createsuperuserStart the Django development server:
uv run ./manage.py runserverTo run Celery against RabbitMQ locally, point the CELERY_BROKER_URL environment variable at your broker if you are not using the default guest account on localhost.
Start a worker:
uv run celery -A bifrost worker --loglevel=infoStart Celery Beat:
uv run celery -A bifrost beat --loglevel=infoUseful local URLs:
- App health endpoint:
http://127.0.0.1:8000/health - Django admin:
http://127.0.0.1:8000/admin/
The Docker image uses bifrost.settings.production, which requires the SECRET_KEY, ALLOWED_HOSTS, DATABASE_URL, and CSRF_TRUSTED_ORIGINS environment variables to be set at runtime.
GitHub Actions publishes the image to ghcr.io/<owner>/<repo> on every branch push using a branch-prefixed SHA tag, and on pushes of tags matching v* using the semantic version tag.
Build the image:
docker build -t bifrost .To run the app against PostgreSQL in Docker, start a database container on a shared network and point DATABASE_URL at it:
docker network create bifrost
docker run -d --rm \
--name bifrost-db \
--network bifrost \
-e POSTGRES_DB=bifrost \
-e POSTGRES_USER=bifrost \
-e POSTGRES_PASSWORD=bifrost \
postgres:16
docker run --rm -p 8000:8000 \
--network bifrost \
-e SECRET_KEY=change-me \
-e ALLOWED_HOSTS='*' \
-e DATABASE_URL='postgresql://bifrost:bifrost@bifrost-db:5432/bifrost' \
bifrostAfter every code change, run the full local verification suite:
uv run ruff format .
uv run ruff check --fix .
uv run mypy .
uv run ./manage.py test