Skip to content

DyHealthNet/DHN-docker

Repository files navigation

DyHealthNet Docker Repository

This repo combines the backend, frontend and database part of the DyHealthNet platform and is purely used to build + deploy the resulting docker containers.

Usage

Warning

Clone the repo with the submodules. To do that, use this command:

git clone --recurse-submodules https://github.com/DyHealthNet/dhn-docker.git

After cloning the repo, just copy the .example.env to .env and fill out all the necessary values.

Afterwards, you can do:

docker-compose up -d

and everything will build and start automatically.

For the website to work and be filled, all scores need to be calculated and the database needs to be filled. This is done automatically on startup. If something went wrong and you need to reinitialize the database, you can do so by running:

docker-compose exec backend python manage.py initialise_db -f

Make sure everything is working by doing a healthcheck:

docker-compose exec backend python manage.py healthcheck

Docker Swarm Deployment

dhn-stack-pipeline

To deploy the stack in a docker swarm, you can do the following:

First, build the images:

docker build -t dhn-backend -f backend/Dockerfile .
docker build -t dhn-frontend -f frontend/Dockerfile frontend
docker build -t dhn-celery -f backend/Dockerfile.celery .

Make sure you fill out the .env file with the necessary values.

Then, you need to initialize the swarm:

docker swarm init

Afterwards, you can deploy the stack:

docker stack deploy -c docker-compose.yml dhn_stack

Check the status of the stack:

docker stack ps dhn_stack

Note that the first time you deploy the stack, the backend will need to calculate all the scores and fill the database. This can take a while.

You can also remove the stack again via:

docker stack rm dhn_stack

Scaling the backend and celery workers is also easy, it will automatically distribute the load:

docker service scale dhn_stack_backend=2
docker service scale dhn_stack_celery=4

Lastly, leave the swarm:

docker swarm leave --force

About

Prototype of the full DyHealthNet platform for exploring population cohort data

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors