Updated Libraries, fixed Docker Compose (#908)

* Updated SpringBoot, HAPI FHIR, Docker

* Fixed docker compose

* Fixed Chart README

* Replaced Tomcat image

* Replaced Tomcat image

* Fixing Tomcat image

* Corrected Helm Chart value
This commit is contained in:
Michele Adduci
2026-01-20 07:59:11 +01:00
committed by GitHub
parent 547d6181ae
commit a3d6fdb52a
9 changed files with 68 additions and 101 deletions

View File

@@ -17,7 +17,7 @@ env:
jobs: jobs:
build: build:
name: Build name: Build
runs-on: ubuntu-22.04 runs-on: ubuntu-24.04
steps: steps:
- name: Container meta for default (distroless) image - name: Container meta for default (distroless) image
id: docker_meta id: docker_meta

View File

@@ -9,7 +9,7 @@ on:
jobs: jobs:
lint: lint:
runs-on: ubuntu-22.04 runs-on: ubuntu-24.04
container: quay.io/helmpack/chart-testing:v3.11.0@sha256:f2fd21d30b64411105c7eafb1862783236a219d29f2292219a09fe94ca78ad2a container: quay.io/helmpack/chart-testing:v3.11.0@sha256:f2fd21d30b64411105c7eafb1862783236a219d29f2292219a09fe94ca78ad2a
steps: steps:
- name: Install helm-docs - name: Install helm-docs
@@ -38,10 +38,10 @@ jobs:
run: ct lint --config .github/ct/config.yaml run: ct lint --config .github/ct/config.yaml
test: test:
runs-on: ubuntu-22.04 runs-on: ubuntu-24.04
strategy: strategy:
matrix: matrix:
k8s-version: [1.30.8, 1.31.4, 1.32.0] k8s-version: [1.32.0, 1.33.0, 1.34.0, 1.35.0]
needs: needs:
- lint - lint
steps: steps:

View File

@@ -1,7 +1,7 @@
FROM docker.io/library/maven:3.9.9-eclipse-temurin-17 AS build-hapi FROM docker.io/library/maven:3.9.12-eclipse-temurin-17 AS build-hapi
WORKDIR /tmp/hapi-fhir-jpaserver-starter WORKDIR /tmp/hapi-fhir-jpaserver-starter
ARG OPENTELEMETRY_JAVA_AGENT_VERSION=2.13.1 ARG OPENTELEMETRY_JAVA_AGENT_VERSION=2.24.0
RUN curl -LSsO https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OPENTELEMETRY_JAVA_AGENT_VERSION}/opentelemetry-javaagent.jar RUN curl -LSsO https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v${OPENTELEMETRY_JAVA_AGENT_VERSION}/opentelemetry-javaagent.jar
COPY pom.xml . COPY pom.xml .
@@ -16,28 +16,26 @@ RUN mvn package -DskipTests spring-boot:repackage -Pboot
RUN mkdir /app && cp /tmp/hapi-fhir-jpaserver-starter/target/ROOT.war /app/main.war RUN mkdir /app && cp /tmp/hapi-fhir-jpaserver-starter/target/ROOT.war /app/main.war
########### bitnami tomcat version is suitable for debugging and comes with a shell ########### Use the official Tomcat image as base image for the Tomcat variant
########### it can be built using eg. `docker build --target tomcat .` ########### it can be built using eg. `docker build --target tomcat .`
FROM docker.io/bitnamilegacy/tomcat:10.1.43-debian-12-r0 AS tomcat FROM docker.io/library/tomcat:10-jre21-temurin-noble AS tomcat
USER root USER root
RUN rm -rf /opt/bitnami/tomcat/webapps/ROOT && \ RUN rm -rf /usr/local/tomcat/webapps/ROOT && \
mkdir -p /opt/bitnami/hapi/data/hapi/lucenefiles && \ mkdir -p /usr/local/tomcat/data/hapi/lucenefiles && \
chown -R 1001:1001 /opt/bitnami/hapi/data/hapi/lucenefiles && \ chown -R 65532:65532 /usr/local/tomcat/data/hapi/lucenefiles && \
chmod 775 /opt/bitnami/hapi/data/hapi/lucenefiles chmod 775 /usr/local/tomcat/data/hapi/lucenefiles
RUN mkdir -p /target && chown -R 1001:1001 target RUN mkdir -p /target && chown -R 65532:65532 /target
USER 1001 USER 65532
COPY --chown=1001:1001 catalina.properties /opt/bitnami/tomcat/conf/catalina.properties COPY --chown=65532:65532 catalina.properties /usr/local/tomcat/conf/catalina.properties
COPY --chown=1001:1001 server.xml /opt/bitnami/tomcat/conf/server.xml COPY --chown=65532:65532 server.xml /usr/local/tomcat/conf/server.xml
COPY --from=build-hapi --chown=1001:1001 /tmp/hapi-fhir-jpaserver-starter/target/ROOT.war /opt/bitnami/tomcat/webapps/ROOT.war COPY --from=build-hapi --chown=65532:65532 /tmp/hapi-fhir-jpaserver-starter/target/ROOT.war /usr/local/tomcat/webapps/ROOT.war
COPY --from=build-hapi --chown=1001:1001 /tmp/hapi-fhir-jpaserver-starter/opentelemetry-javaagent.jar /app COPY --from=build-hapi --chown=65532:65532 /tmp/hapi-fhir-jpaserver-starter/opentelemetry-javaagent.jar /app
ENV ALLOW_EMPTY_PASSWORD=yes
########### distroless brings focus on security and runs on plain spring boot - this is the default image ########### distroless brings focus on security and runs on plain spring boot - this is the default image
FROM gcr.io/distroless/java17-debian12:nonroot AS default FROM gcr.io/distroless/java21-debian13:nonroot AS default
# 65532 is the nonroot user's uid # 65532 is the nonroot user's uid
# used here instead of the name to allow Kubernetes to easily detect that the container # used here instead of the name to allow Kubernetes to easily detect that the container
# is running as a non-root (uid != 0) user. # is running as a non-root (uid != 0) user.

View File

@@ -13,8 +13,8 @@ dependencies:
- name: common - name: common
repository: oci://registry-1.docker.io/bitnamicharts repository: oci://registry-1.docker.io/bitnamicharts
version: 2.31.3 version: 2.31.3
appVersion: 8.2.0 appVersion: 8.6.0
version: 0.21.0 version: 0.22.0
annotations: annotations:
artifacthub.io/license: Apache-2.0 artifacthub.io/license: Apache-2.0
artifacthub.io/containsSecurityUpdates: "false" artifacthub.io/containsSecurityUpdates: "false"

View File

@@ -1,6 +1,6 @@
# HAPI FHIR JPA Server Starter Helm Chart # HAPI FHIR JPA Server Starter Helm Chart
![Version: 0.21.0](https://img.shields.io/badge/Version-0.21.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 8.2.0](https://img.shields.io/badge/AppVersion-8.2.0-informational?style=flat-square) ![Version: 0.22.0](https://img.shields.io/badge/Version-0.22.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 8.6.0](https://img.shields.io/badge/AppVersion-8.6.0-informational?style=flat-square)
This helm chart will help you install the HAPI FHIR JPA Server in a Kubernetes environment. This helm chart will help you install the HAPI FHIR JPA Server in a Kubernetes environment.
@@ -39,7 +39,7 @@ helm install hapi-fhir-jpaserver hapifhir/hapi-fhir-jpaserver
| image.pullPolicy | string | `"IfNotPresent"` | image pullPolicy to use | | image.pullPolicy | string | `"IfNotPresent"` | image pullPolicy to use |
| image.registry | string | `"docker.io"` | registry where the HAPI FHIR server image is hosted | | image.registry | string | `"docker.io"` | registry where the HAPI FHIR server image is hosted |
| image.repository | string | `"hapiproject/hapi"` | the path inside the repository | | image.repository | string | `"hapiproject/hapi"` | the path inside the repository |
| image.tag | string | `"v8.2.0-1@sha256:e85ded02f60e25a66e6d9423ea71f3ebc9494e3a69bdd7d7dbfa31b8aa5b2fe9"` | the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. | | image.tag | string | `"v8.6.0-1@sha256:7611e4d6601f35dd8c223ed2ed47a2807be06976f71b2e5990e6541bbc90c16f"` | the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. |
| imagePullSecrets | list | `[]` | image pull secrets to use when pulling the image | | imagePullSecrets | list | `[]` | image pull secrets to use when pulling the image |
| ingress.annotations | object | `{}` | provide any additional annotations which may be required. Evaluated as a template. | | ingress.annotations | object | `{}` | provide any additional annotations which may be required. Evaluated as a template. |
| ingress.enabled | bool | `false` | whether to create an Ingress to expose the FHIR server HTTP endpoint | | ingress.enabled | bool | `false` | whether to create an Ingress to expose the FHIR server HTTP endpoint |

View File

@@ -7,7 +7,7 @@ image:
# -- the path inside the repository # -- the path inside the repository
repository: hapiproject/hapi repository: hapiproject/hapi
# -- the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image. # -- the image tag. As of v5.7.0, this is the `distroless` flavor by default, add `-tomcat` to use the Tomcat-based image.
tag: "v8.2.0-1@sha256:e85ded02f60e25a66e6d9423ea71f3ebc9494e3a69bdd7d7dbfa31b8aa5b2fe9" tag: "v8.6.0-1@sha256:7611e4d6601f35dd8c223ed2ed47a2807be06976f71b2e5990e6541bbc90c16f"
# -- image pullPolicy to use # -- image pullPolicy to use
pullPolicy: IfNotPresent pullPolicy: IfNotPresent

View File

@@ -1 +1 @@
docker build --tag hapiproject/hapi:latest --tag hapiproject/hapi:4.1 -m 4g . docker build --tag hapiproject/hapi:latest --tag hapiproject/hapi:8.6.1 -m 4g .

View File

@@ -1,4 +1,3 @@
version: "3"
services: services:
hapi-fhir-jpaserver-start: hapi-fhir-jpaserver-start:
build: . build: .
@@ -8,18 +7,29 @@ services:
SPRING_DATASOURCE_URL: "jdbc:postgresql://hapi-fhir-postgres:5432/hapi" SPRING_DATASOURCE_URL: "jdbc:postgresql://hapi-fhir-postgres:5432/hapi"
SPRING_DATASOURCE_USERNAME: "admin" SPRING_DATASOURCE_USERNAME: "admin"
SPRING_DATASOURCE_PASSWORD: "admin" SPRING_DATASOURCE_PASSWORD: "admin"
SPRING_DATASOURCE_DRIVERCLASSNAME: "org.postgresql.Driver" SPRING_DATASOURCE_DRIVER_CLASS_NAME: "org.postgresql.Driver"
SPRING_JPA_PROPERTIES_HIBERNATE_DIALECT: ca.uhn.fhir.jpa.model.dialect.HapiFhirPostgresDialect
ports: ports:
- "8080:8080" - "8080:8080"
depends_on:
hapi-fhir-postgres:
condition: service_healthy
hapi-fhir-postgres: hapi-fhir-postgres:
image: postgres:15-alpine image: postgres:16-alpine
container_name: hapi-fhir-postgres container_name: hapi-fhir-postgres
restart: always restart: always
environment: environment:
POSTGRES_DB: "hapi" POSTGRES_DB: "hapi"
POSTGRES_USER: "admin" POSTGRES_USER: "admin"
POSTGRES_PASSWORD: "admin" POSTGRES_PASSWORD: "admin"
healthcheck:
test: ["CMD-SHELL", "sh -c 'pg_isready -U admin -d hapi' || exit 1"]
interval: 10s
timeout: 5s
start_period: 5s
retries: 5
volumes: volumes:
- hapi-fhir-postgres:/var/lib/postgresql/data - hapi-fhir-postgres:/var/lib/postgresql/data
volumes: volumes:
hapi-fhir-postgres: hapi-fhir-postgres:

101
pom.xml
View File

@@ -7,6 +7,20 @@
<java.version>17</java.version> <java.version>17</java.version>
<hapi.fhir.jpa.server.starter.revision>1</hapi.fhir.jpa.server.starter.revision> <hapi.fhir.jpa.server.starter.revision>1</hapi.fhir.jpa.server.starter.revision>
<clinical-reasoning.version>4.0.0</clinical-reasoning.version> <clinical-reasoning.version>4.0.0</clinical-reasoning.version>
<!-- Plugins Versions -->
<maven.failsafe.version>3.5.4</maven.failsafe.version>
<maven.fire.version>${maven.failsafe.version}</maven.fire.version>
<maven.dependency.version>3.9.0</maven.dependency.version>
<maven.compiler.version>3.14.1</maven.compiler.version>
<!-- Dependencies Versions -->
<spring.ai.version>1.1.2</spring.ai.version>
<awaitility.version>4.3.0</awaitility.version>
<micrometer.version>1.16.2</micrometer.version>
<commons.logging.version>1.3.5</commons.logging.version>
<spring_boot_version>3.5.9</spring_boot_version>
<postgresql.version>42.7.9</postgresql.version>
</properties> </properties>
<!-- one-liner to take you to the cloud with settings form the application.yaml file: --> <!-- one-liner to take you to the cloud with settings form the application.yaml file: -->
@@ -20,7 +34,7 @@
<parent> <parent>
<groupId>ca.uhn.hapi.fhir</groupId> <groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId> <artifactId>hapi-fhir</artifactId>
<version>8.6.0</version> <version>8.6.1</version>
</parent> </parent>
<artifactId>hapi-fhir-jpaserver-starter</artifactId> <artifactId>hapi-fhir-jpaserver-starter</artifactId>
@@ -73,6 +87,7 @@
<dependency> <dependency>
<groupId>org.postgresql</groupId> <groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId> <artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.microsoft.sqlserver</groupId> <groupId>com.microsoft.sqlserver</groupId>
@@ -222,7 +237,7 @@
<dependency> <dependency>
<groupId>commons-logging</groupId> <groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId> <artifactId>commons-logging</artifactId>
<version>1.2</version> <version>${commons.logging.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
@@ -344,7 +359,7 @@
<dependency> <dependency>
<groupId>org.awaitility</groupId> <groupId>org.awaitility</groupId>
<artifactId>awaitility</artifactId> <artifactId>awaitility</artifactId>
<version>4.2.0</version> <version>${awaitility.version}</version>
<scope>test</scope> <scope>test</scope>
</dependency> </dependency>
@@ -364,41 +379,41 @@
<dependency> <dependency>
<groupId>io.micrometer</groupId> <groupId>io.micrometer</groupId>
<artifactId>micrometer-core</artifactId> <artifactId>micrometer-core</artifactId>
<version>1.13.3</version> <version>${micrometer.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus --> <!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus -->
<dependency> <dependency>
<groupId>io.micrometer</groupId> <groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId> <artifactId>micrometer-registry-prometheus</artifactId>
<version>1.13.3</version> <version>${micrometer.version}</version>
</dependency> </dependency>
<!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus-simpleclient --> <!-- https://mvnrepository.com/artifact/io.micrometer/micrometer-registry-prometheus-simpleclient -->
<dependency> <dependency>
<groupId>io.micrometer</groupId> <groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus-simpleclient</artifactId> <artifactId>micrometer-registry-prometheus-simpleclient</artifactId>
<version>1.13.3</version> <version>${micrometer.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.zaxxer</groupId> <groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId> <artifactId>HikariCP</artifactId>
<version>5.0.1</version> <version>5.1.0</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.ai</groupId> <groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-mcp</artifactId> <artifactId>spring-ai-mcp</artifactId>
<version>1.1.0-M2</version> <version>${spring.ai.version}</version>
</dependency> </dependency>
<!--implementation("org.springframework.ai:spring-ai-starter-mcp-server-webmvc:1.1.0-M1")--> <!--implementation("org.springframework.ai:spring-ai-starter-mcp-server-webmvc:1.1.0-M1")-->
<dependency> <dependency>
<groupId>org.springframework.ai</groupId> <groupId>org.springframework.ai</groupId>
<artifactId>spring-ai-starter-mcp-server</artifactId> <artifactId>spring-ai-starter-mcp-server</artifactId>
<version>1.1.0-M2</version> <version>${spring.ai.version}</version>
</dependency> </dependency>
<dependency> <dependency>
@@ -433,12 +448,12 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId> <artifactId>maven-dependency-plugin</artifactId>
<version>3.6.0</version> <version>${maven.dependency.version}</version>
</plugin> </plugin>
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId> <artifactId>maven-fire-plugin</artifactId>
<version>3.4.0</version> <version>${maven.fire.version}</version>
</plugin> </plugin>
</plugins> </plugins>
</pluginManagement> </pluginManagement>
@@ -474,7 +489,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId> <artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version> <version>${maven.compiler.version}</version>
<configuration> <configuration>
<release>${java.version}</release> <release>${java.version}</release>
</configuration> </configuration>
@@ -505,7 +520,7 @@
<plugin> <plugin>
<groupId>org.apache.maven.plugins</groupId> <groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId> <artifactId>maven-failsafe-plugin</artifactId>
<version>3.4.0</version> <version>${maven.failsafe.version}</version>
<configuration> <configuration>
<redirectTestOutputToFile>true</redirectTestOutputToFile> <redirectTestOutputToFile>true</redirectTestOutputToFile>
</configuration> </configuration>
@@ -677,62 +692,6 @@
</dependency> </dependency>
</dependencies> </dependencies>
</profile> </profile>
<profile>
<id>ossrh-repo</id>
<activation>
<activeByDefault>false</activeByDefault>
<property>
<name>deployToSonatype</name>
</property>
</activation>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<build>
<plugins>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.13</version>
<extensions>true</extensions>
<configuration>
<serverId>ossrh</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
<configuration>
<keyname>${gpg.keyname}</keyname>
<passphraseServerId>${gpg.keyname}</passphraseServerId>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
<!-- For connecting to GCP CloudSQL Postgres instances: <!-- For connecting to GCP CloudSQL Postgres instances:
https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/blob/main/docs/jdbc.md#postgres-1 https://github.com/GoogleCloudPlatform/cloud-sql-jdbc-socket-factory/blob/main/docs/jdbc.md#postgres-1
Needs 'boot' profile as well. --> Needs 'boot' profile as well. -->
@@ -742,7 +701,7 @@
<dependency> <dependency>
<groupId>com.google.cloud.sql</groupId> <groupId>com.google.cloud.sql</groupId>
<artifactId>postgres-socket-factory</artifactId> <artifactId>postgres-socket-factory</artifactId>
<version>1.17.0</version> <version>1.28.0</version>
</dependency> </dependency>
</dependencies> </dependencies>
</profile> </profile>