This code demonstrates how to start a HAPI FHIR server using Docker Compose and implicitly load an Implementation Guide (IG) upon startup. The setup leverages both Docker Compose and Spring Boot configuration mechanisms to achieve this. The code and accompanying configuration files provide a streamlined approach to deploying a HAPI FHIR server pre-configured with a specific IG, simplifying development and testing. The following sections will detail the process:
-
Docker Compose and Configuration Injection (including Spring Boot): This subsection explains how Docker Compose is used to mount the necessary configuration files, including those for Spring Boot, into the HAPI FHIR server container, enabling the server to load the IG on startup.
-
HAPI FHIR Configuration Details: This subsection delves into the specifics of the HAPI FHIR configuration files, explaining the structure and meaning of the settings used to define the IG and its loading behavior within the HAPI FHIR server.
- Make sure you have Docker and Docker Compose installed.
- Navigate to the directory containing the
docker-compose.yml
file in your terminal. - Run
docker-compose up -d
to start the containers in detached mode. - The HAPI FHIR server will start, connect to the Postgres database, and automatically install the AU Core IG based on your
application.yaml
configuration.
- Access the HAPI FHIR server at
http://localhost:8080
. - You should be able to see the AU Core IG in the CapabilityStatement or by querying the ImplementationGuide resources. You can use the HAPI FHIR test client or tools like Postman to interact with the server.
- Logs: Check the logs of the
hapi-fhir-server
container usingdocker-compose logs hapi-fhir-server
for any errors during startup or IG installation. - Database: If you have issues with the database, ensure that the credentials in your
docker-compose.yml
andapplication.yaml
match. - IG URL: Double-check the URL of your Implementation Guide. A typo or incorrect path will prevent installation.
This comprehensive example should help you experiment with the AU Core FHIR Implementation Guide using HAPI FHIR and Docker Compose. Remember to replace the placeholder values in the configuration files with your actual IG URL, version, and FHIR version.