version: "3"
services:
  hapi-fhir-jpaserver-start:
    build: .
    container_name: hapi-fhir-jpaserver-start
    restart: on-failure
    environment:
      SPRING_DATASOURCE_URL: "jdbc:postgresql://hapi-fhir-postgres:5432/hapi"
      SPRING_DATASOURCE_USERNAME: "admin"
      SPRING_DATASOURCE_PASSWORD: "admin"
      SPRING_DATASOURCE_DRIVERCLASSNAME: "org.postgresql.Driver"
    ports:
      - "8080:8080"
  hapi-fhir-postgres:
    image: postgres:15-alpine
    container_name: hapi-fhir-postgres
    restart: always
    environment:
      POSTGRES_DB: "hapi"
      POSTGRES_USER: "admin"
      POSTGRES_PASSWORD: "admin"
    volumes:
      - hapi-fhir-postgres:/var/lib/postgresql/data
volumes:
  hapi-fhir-postgres:
