Skip to content

This is the docker compose files to set up a HAPI FHIR server locally

Notifications You must be signed in to change notification settings

medblocks/hapi-fhir-docker-compose

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

I'll provide a beginner-friendly guide to help you set up and run these FHIR server files on both Mac and Windows.

Understanding the Files

First, let's understand what these files are:

  1. docker-compose.yml: This is a configuration file that defines how to run two connected services:

    • A FHIR server (which is a healthcare data server)
    • A PostgreSQL database to store the data
  2. hapi.application.yaml: This is a configuration file for the FHIR server that tells it how to connect to the database.

Step-by-Step Setup Guide

1. Install Docker Desktop

Docker is the main tool we need. It allows us to run applications in containers (think of them as lightweight virtual computers).

For Windows:

  1. Visit Docker Desktop for Windows
  2. Click "Download for Windows"
  3. Run the installer
  4. During installation, if prompted to install WSL 2, allow it
  5. Restart your computer after installation

For Mac:

  1. Visit Docker Desktop for Mac
  2. Click "Download for Mac"
  3. Choose Apple Chip if you have M1/M2 Mac, or Intel Chip for older Macs
  4. Double-click the downloaded .dmg file
  5. Drag Docker to Applications folder
  6. Start Docker from Applications

2. Create Project Directory and Files

  1. Create a new folder anywhere on your computer (e.g., "fhir-project")
  2. Inside this folder, create two files:
    • docker-compose.yml - copy the first code block into it
    • hapi.application.yaml - copy the second code block into it

3. Run the Application

  1. Open Terminal (Mac) or Command Prompt (Windows)
  2. Navigate to your project folder:
cd path/to/your/fhir-project
  1. Start the containers:
docker compose up

This command will:

  • Download the necessary images (might take a few minutes first time)
  • Start both the FHIR server and database
  • Show you the logs in the terminal

4. Verify It's Working

  1. Open your web browser
  2. Go to: http://localhost:8080
  3. You should see the HAPI FHIR server welcome page

Common Issues and Solutions:

  1. "docker command not found"

    • Make sure Docker Desktop is running
    • Try restarting your computer
  2. "Port 8080 already in use"

    • Change the port in docker-compose.yml from "8080:8080" to something like "8081:8080"
  3. "Permission denied" (Mac/Linux)

    • Add sudo before the command: sudo docker compose up

To Stop the Application:

  1. In the terminal where it's running, press Ctrl+C (Windows) or Cmd+C (Mac)
  2. To completely clean up, run:
docker compose down

Additional Tips:

  • Always make sure Docker Desktop is running before trying to use docker commands
  • The first run will be slower as it downloads the necessary images
  • If you make changes to the configuration files, you'll need to restart the containers
  • Use docker compose up -d to run in detached mode (background)
  • Use docker compose logs to see the logs when running in detached mode

About

This is the docker compose files to set up a HAPI FHIR server locally

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published