diff --git a/Dockerfile b/Dockerfile index c5fa147..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 @@ -7,5 +8,9 @@ COPY --chown=gradle:gradle . . RUN gradle build # Expose port to access the app EXPOSE 8080 + +#HealthCheck +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 383f535..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 @@ -8,5 +9,8 @@ RUN gradle build # Expose port to access the app EXPOSE 8080 EXPOSE 8081 + +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 ff3b832..d790ba8 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=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