From a16dbce7aa7558a52e1bd5c835d32bd14408a127 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Thu, 7 Dec 2023 19:12:37 -0500 Subject: [PATCH 1/5] add curl and health check --- Dockerfile | 8 ++++++++ Dockerfile.dev | 7 +++++++ Dockerfile.keycloak | 9 +++++++++ 3 files changed, 24 insertions(+) diff --git a/Dockerfile b/Dockerfile index c5fa147..1989c56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,5 +7,13 @@ COPY --chown=gradle:gradle . . RUN gradle build # Expose port to access the app EXPOSE 8080 + +#HealthCheck +RUN apk update +RUN apk upgrade +RUN apk search curl +RUN apk add curl +HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080 || exit 1 + # Command to run our app CMD ./dockerRunnerProd.sh \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev index 383f535..99b823f 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -8,5 +8,12 @@ RUN gradle build # Expose port to access the app EXPOSE 8080 EXPOSE 8081 + +RUN apk update +RUN apk upgrade +RUN apk search curl +RUN apk add curl +HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080 || exit 1 + # Command to run our app CMD ./dockerRunnerDev.sh \ No newline at end of file diff --git a/Dockerfile.keycloak b/Dockerfile.keycloak index ff3b832..67642ff 100644 --- a/Dockerfile.keycloak +++ b/Dockerfile.keycloak @@ -1,2 +1,11 @@ +FROM registry.access.redhat.com/ubi9 AS ubi-micro-build +RUN mkdir -p /mnt/rootfs +RUN dnf install --installroot /mnt/rootfs curl --releasever 9 --setopt install_weak_deps=false --nodocs -y && \ + dnf --installroot /mnt/rootfs clean all && \ + rpm --root /mnt/rootfs -e --nodeps setup + + FROM keycloak/keycloak:22.0.1 +COPY --from=ubi-micro-build /mnt/rootfs / +HEALTHCHECK --interval=60s --timeout=10m --retries=10 CMD curl --fail http://localhost:8080 || exit 1 COPY ./src/main/resources/ClientFhirServerRealm.json /opt/keycloak/data/import/ClientFhirServerRealm.json \ No newline at end of file From 7d38360a70ca9774b09c60a73b51e23c742a9069 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Thu, 7 Dec 2023 21:06:50 -0500 Subject: [PATCH 2/5] updates package installer --- Dockerfile | 8 ++++---- Dockerfile.dev | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1989c56..c9d190b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,10 +9,10 @@ RUN gradle build EXPOSE 8080 #HealthCheck -RUN apk update -RUN apk upgrade -RUN apk search curl -RUN apk add curl +RUN apt update +RUN apt upgrade +RUN apt search curl +RUN apt add curl HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080 || exit 1 # Command to run our app diff --git a/Dockerfile.dev b/Dockerfile.dev index 99b823f..b6124a6 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -9,10 +9,10 @@ RUN gradle build EXPOSE 8080 EXPOSE 8081 -RUN apk update -RUN apk upgrade -RUN apk search curl -RUN apk add curl +RUN apt update +RUN apt upgrade +RUN apt search curl +RUN apt add curl HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080 || exit 1 # Command to run our app From 7289f6dcb93eca4dc57e1f155df5b05db083597b Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Thu, 7 Dec 2023 21:11:56 -0500 Subject: [PATCH 3/5] uninstall curl --- Dockerfile | 4 ---- Dockerfile.dev | 4 ---- 2 files changed, 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index c9d190b..6656d82 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,10 +9,6 @@ RUN gradle build EXPOSE 8080 #HealthCheck -RUN apt update -RUN apt upgrade -RUN apt search curl -RUN apt add curl HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080 || exit 1 # Command to run our app diff --git a/Dockerfile.dev b/Dockerfile.dev index b6124a6..4a416bf 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -9,10 +9,6 @@ RUN gradle build EXPOSE 8080 EXPOSE 8081 -RUN apt update -RUN apt upgrade -RUN apt search curl -RUN apt add curl HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080 || exit 1 # Command to run our app From 6c2aea3a250c0c26ca7bfa50711b95435894d74f Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Mon, 26 Aug 2024 14:41:47 -0400 Subject: [PATCH 4/5] health check updates --- Dockerfile | 2 +- Dockerfile.dev | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6656d82..7542908 100644 --- a/Dockerfile +++ b/Dockerfile @@ -9,7 +9,7 @@ RUN gradle build EXPOSE 8080 #HealthCheck -HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080 || exit 1 +HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080/test-ehr/r4/metadata || exit 1 # Command to run our app CMD ./dockerRunnerProd.sh \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev index 4a416bf..ec3a439 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -9,7 +9,7 @@ RUN gradle build EXPOSE 8080 EXPOSE 8081 -HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080 || exit 1 +HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080/test-ehr/r4/metadata || exit 1 # Command to run our app CMD ./dockerRunnerDev.sh \ No newline at end of file From a9e0433856dda86ae99a4309f829700d93acbee9 Mon Sep 17 00:00:00 2001 From: Sahil Malhotra Date: Tue, 27 Aug 2024 12:16:12 -0400 Subject: [PATCH 5/5] health check updates --- Dockerfile | 3 ++- Dockerfile.dev | 3 ++- Dockerfile.keycloak | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7542908..0ea2066 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,6 @@ # Base image FROM gradle:6.9.0-jdk11 + # Set working directory so that all subsequent command runs in this folder WORKDIR /test-ehr # Copy app files to container @@ -9,7 +10,7 @@ RUN gradle build EXPOSE 8080 #HealthCheck -HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080/test-ehr/r4/metadata || exit 1 +HEALTHCHECK --interval=45s --start-period=60s --timeout=10m --retries=10 CMD curl --fail http://localhost:8080/test-ehr/r4/metadata || exit 1 # Command to run our app CMD ./dockerRunnerProd.sh \ No newline at end of file diff --git a/Dockerfile.dev b/Dockerfile.dev index ec3a439..46c3ad1 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,5 +1,6 @@ # Base image FROM gradle:6.9.0-jdk11 + # Set working directory so that all subsequent command runs in this folder WORKDIR /test-ehr # Copy app files to container @@ -9,7 +10,7 @@ RUN gradle build EXPOSE 8080 EXPOSE 8081 -HEALTHCHECK --interval=60s --timeout=10m --retries=5 CMD curl --fail http://localhost:8080/test-ehr/r4/metadata || exit 1 +HEALTHCHECK --interval=45s --start-period=60s --timeout=10m --retries=10 CMD curl --fail http://localhost:8080/test-ehr/r4/metadata || exit 1 # Command to run our app CMD ./dockerRunnerDev.sh \ No newline at end of file diff --git a/Dockerfile.keycloak b/Dockerfile.keycloak index 67642ff..d790ba8 100644 --- a/Dockerfile.keycloak +++ b/Dockerfile.keycloak @@ -7,5 +7,5 @@ RUN dnf install --installroot /mnt/rootfs curl --releasever 9 --setopt install_w FROM keycloak/keycloak:22.0.1 COPY --from=ubi-micro-build /mnt/rootfs / -HEALTHCHECK --interval=60s --timeout=10m --retries=10 CMD curl --fail http://localhost:8080 || exit 1 +HEALTHCHECK --interval=30s --start-period=15s --timeout=10m --retries=10 CMD curl --fail http://localhost:8080 || exit 1 COPY ./src/main/resources/ClientFhirServerRealm.json /opt/keycloak/data/import/ClientFhirServerRealm.json \ No newline at end of file