From 75503466cdd8628e0d084b21349bd07b831e2e1d Mon Sep 17 00:00:00 2001 From: Panayiotis Savva Date: Wed, 23 Sep 2020 20:13:22 +0300 Subject: [PATCH 1/5] Spring batch job enabled (#144) * Remove Batch job enabled=false * Batch job Enabled default to False --- README.md | 8 ++++---- src/main/resources/application.yaml | 2 ++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 774af56..3f390be 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Each tagged/released version of `hapi-fhir-jpaserver` is built as a Docker image ``` docker pull hapiproject/hapi:latest -docker run -p 8080:8080 -e "spring.batch.job.enabled=false" hapiproject/hapi:tagname +docker run -p 8080:8080 hapiproject/hapi:tagname ``` This will run the docker image with the default configuration, mapping port 8080 from the container to port 8080 in the host. Once running, you can access `http://localhost:8080/hapi-fhir-jpaserver/` in the browser to access the HAPI FHIR server's UI. @@ -76,7 +76,7 @@ The easiest way to run this server entirely depends on your environment requirem ### Using jetty ```bash -mvn jetty:run -Dspring.batch.job.enabled=false +mvn jetty:run ``` @@ -117,7 +117,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos ``` ### Using Spring Boot and Google distroless ```bash -mvn clean package com.google.cloud.tools:jib-maven-plugin:dockerBuild -Dimage=distroless-hapi && docker run -p 8080:8080 -e spring.batch.job.enabled=false distroless-hapi +mvn clean package com.google.cloud.tools:jib-maven-plugin:dockerBuild -Dimage=distroless-hapi && docker run -p 8080:8080 distroless-hapi ``` Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to eg. @@ -133,7 +133,7 @@ Server will then be accessible at http://localhost:8080/ and eg. http://localhos ### Using the Dockerfile and multistage build ```bash -./build-docker-image.sh && docker run -p 8080:8080 -e "spring.batch.job.enabled=false" hapi-fhir/hapi-fhir-jpaserver-starter:latest +./build-docker-image.sh && docker run -p 8080:8080 hapi-fhir/hapi-fhir-jpaserver-starter:latest ``` Server will then be accessible at http://localhost:8080/ and eg. http://localhost:8080/fhir/metadata. Remember to adjust you overlay configuration in the application.yaml to eg. diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index b7ec776..96a4040 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,4 +1,6 @@ spring: + batch: + job.enabled: false datasource: url: 'jdbc:h2:file:./target/database/h2' username: sa From 8699965569c203e071a6c47a06cbd7c0b1f3ea19 Mon Sep 17 00:00:00 2001 From: Panayiotis Savva Date: Fri, 25 Sep 2020 09:02:28 +0300 Subject: [PATCH 2/5] Remove Duplicate batch job enabled It seems via the adding and removing of the previous PR landed up having 2x the tags for Batch job enabled. Once on line 2, Once on Line 29 --- src/main/resources/application.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/resources/application.yaml b/src/main/resources/application.yaml index 96a4040..b7ec776 100644 --- a/src/main/resources/application.yaml +++ b/src/main/resources/application.yaml @@ -1,6 +1,4 @@ spring: - batch: - job.enabled: false datasource: url: 'jdbc:h2:file:./target/database/h2' username: sa From 5c4a51601f1d113247cb39b918bead878603fd0f Mon Sep 17 00:00:00 2001 From: Jens Kristian Villadsen <46567685+jvitrifork@users.noreply.github.com> Date: Tue, 29 Sep 2020 17:56:02 +0200 Subject: [PATCH 3/5] Update README.md (#149) Adjusted according to current defaults --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 3f390be..43ab456 100644 --- a/README.md +++ b/README.md @@ -201,19 +201,19 @@ To deploy to a container, you should first build the project: mvn clean install ``` -This will create a file called `hapi-fhir-jpaserver.war` in your `target` directory. This should be installed in your Web Container according to the instructions for your particular container. For example, if you are using Tomcat, you will want to copy this file to the `webapps/` directory. +This will create a file called `ROOT.war` in your `target` directory. This should be installed in your Web Container according to the instructions for your particular container. For example, if you are using Tomcat, you will want to copy this file to the `webapps/` directory. Again, browse to the following link to use the server (note that the port 8080 may not be correct depending on how your server is configured). -[http://localhost:8080/hapi-fhir-jpaserver/](http://localhost:8080/hapi-fhir-jpaserver/) +[http://localhost:8080/](http://localhost:8080/hapi-fhir-jpaserver/) -If you would like it to be hosted at the root, eg. http://localhost:8080/ - then rename the WAR file to ```ROOT.war```. +If you would like it to be hosted at eg. hapi-fhir-jpaserver, eg. http://localhost:8080/hapi-fhir-jpaserver/ - then rename the WAR file to ```hapi-fhir-jpaserver.war```. ## Deploy with docker compose Docker compose is a simple option to build and deploy container. To deploy with docker compose, you should build the project with `mvn clean install` and then bring up the containers with `docker-compose up -d --build`. The server can be -reached at http://localhost:8080/hapi-fhir-jpaserver/. +reached at http://localhost:8080/. In order to use another port, change the `ports` parameter inside `docker-compose.yml` to `8888:8080`, where 8888 is a port of your choice. From cb9769f0c3d4224dd0e92cc0ae91af56ae95784a Mon Sep 17 00:00:00 2001 From: Panayiotis Savva Date: Wed, 21 Oct 2020 18:38:58 +0300 Subject: [PATCH 4/5] Docker buid - heap memory error (#155) When building in Docker, we sometimes face a heap memory running out when compiling the WAR file. Setting the MAVEN_OPTS="-Xmx1024m" resolves this --- Dockerfile | 1 + 1 file changed, 1 insertion(+) diff --git a/Dockerfile b/Dockerfile index a6699d5..16ce405 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,6 +5,7 @@ COPY pom.xml . RUN mvn -ntp dependency:go-offline COPY src/ /tmp/hapi-fhir-jpaserver-starter/src/ +RUN set MAVEN_OPTS="-Xmx1024m" RUN mvn clean install -DskipTests FROM tomcat:9.0.38-jdk11-openjdk-slim-buster From 8f06e457df04fa2358c801138751e11917064559 Mon Sep 17 00:00:00 2001 From: Sean McIlvenna Date: Wed, 21 Oct 2020 13:06:31 -0400 Subject: [PATCH 5/5] Revert "Docker buid - heap memory error (#155)" (#156) This reverts commit cb9769f0c3d4224dd0e92cc0ae91af56ae95784a. --- Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 16ce405..a6699d5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,7 +5,6 @@ COPY pom.xml . RUN mvn -ntp dependency:go-offline COPY src/ /tmp/hapi-fhir-jpaserver-starter/src/ -RUN set MAVEN_OPTS="-Xmx1024m" RUN mvn clean install -DskipTests FROM tomcat:9.0.38-jdk11-openjdk-slim-buster