The project is structured as a single Docker Compose containing the following containers:
- an instance of HAPI FHIR server
- an instance of the FHIR server database
- an instance of the FHIR server authentication module. This constitutes a REST API with two endpoints, one to perform login with the credentials (username and password) of an existing user on Keycloak and another to verify the validity of the token returned during login. All requests to the FHIR server should be made by appending the AUTHORIZATION header "Bearer [TOKEN]."
- an instance of the FHIR module exporter.
- [TEST] an instance of the I-Care.Me database. Note: This container is believed to be already present in the I-Care.Me. compose.
- [TEST] an instance of Keycloak. Note: This container is believed to be already present in the I-Care.Me compose.
In addition, to simulate interaction with an external system that connects to the FHIR server to read its data, there are the following containers as well.
- [TEST] an instance of fhirpy proxy. Note: this is not needed in I-Care.Me environment.
- [TEST] an instance of a React Web client. Note: this is not needed in I-Care.Me environment.
Note that the given Docker compose is inspired to the one given by Hapi-fhir-jpaserver-oauth, which also provided the Dockerfile for the hapi server.
Also note that the auth mechanism sends the password and the username as body content, which is not secure. Anyway this is not the focus of the thesis and it must be implemented for real usage.
- Build hapi-fhir-server Docker image:
cd hapi-fhir-jpaserver-oauth-master
docker build -t hapi-fhir-server .
- Build icareme-fhir-exporter Docker image:
cd icareme-fhir-exporter
docker build -t icareme-fhir-exporter .
- Build icareme-fhir-server-auth Docker image:
cd icareme-fhir-server-auth
docker build -t icareme-fhir-server-auth .
- Build fhirpy-proxy Docker image:
cd fhirpy-proxy
docker build -t fhirpy-proxy .
- Build react-client Docker image:
cd react-client
docker build -t react-client .
The .env file contains all the set-up configuration strings. The configurable variables are those under the "EXTERNAL CONFIGURATION" comment.
Run the demonstrator Docker compose
[enter the folder demonstrator/]
docker-compose up
Only after first run, for testing purposes, the following must be configured:
- Keycloak. You must import the realm configuration and create a user, according the credentials specified in .env file (default username: fhir, psw: fhir).
- I-Care.Me database must be initialized with the provided .sql structure file and then filled with some data. You can use the script icareme-db/fill_database.py.
The Docker compose exposes the FHIR server at the address
localhost/8080
the authentication endpoints at
localhost/8081
the exporter module at
localhost/8000
the example react client at
localhost/3000