Skip to content

Docker Services

Sean McIlvenna edited this page Dec 5, 2019 · 2 revisions

In a Docker environment, three Docker containers would be run for a fully functional installation of ToF:

  1. OAuth2 authentication provider (such as keycloak)
  2. FHIR Server (such as HAPI)
  3. ToF (build the image using the Dockerfile in the root of the repository)

Auth

An example of running KeyCloak in a docker container can be found in the KeyCloak Configuration page.

FHIR Server

The hapi-fhir-jpaserver-starter project has a Dockerfile in it that you can use to build an image for HAPI. The Dockerfile in that project currently assumes that the build server has pre-compiled the application.

ToF

Once those dependencies are running in Docker, you can build a docker image for ToF by running docker build --tag tof:latest . from the root directory of the repository and run it using docker run tof:latest. Note, however, that you would need to change the configuration for ToF in the /tof/apps/server/config directory to point to the fhir server and authentication provider being run as separate docker containers. That can be done using a docker config.

Using docker config requires the docker environment to be a swarm. You can setup your docker installation as a swarm using docker swarm init.

Assuming you have docker running in a swarm, you can create a config for tof by running docker config create tof-config --file local.json. In this case, local.json is the custom configurations that should overwrite default.json. After the config has been created in docker, you can bind/mount the config inside the tof container. See Use bind mounts for more information on how to do that.