diff --git a/.github/Dockerfile_PreBuild b/.github/Dockerfile_PreBuild index 7827150243..61c37dce74 100644 --- a/.github/Dockerfile_PreBuild +++ b/.github/Dockerfile_PreBuild @@ -1,10 +1,7 @@ -FROM jetty:9.4-jdk11-alpine +FROM gcr.io/distroless/java:11 -ENV JMX_EXPORTER_VERSION=1.2.0 - -# To enable add "-javaagent:$JETTY_BASE/jmx-exporter.jar=8090:$JETTY_BASE/prometheus_config.yml" to the JAVA_OPTIONS -RUN wget https://github.com/prometheus/jmx_exporter/releases/download/$JMX_EXPORTER_VERSION/jmx_prometheus_javaagent-$JMX_EXPORTER_VERSION.jar -o /var/lib/jetty/jmx-exporter.jar -COPY .github/jmx_exporter.config /var/lib/jetty/prometheus_config.yml # Copy OBP source code # Copy build artifact (.war file) into jetty from 'maven' stage. -COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war +COPY /obp-http4s-runner/target/obp-http4s-runner.jar /app/obp-http4s-runner.jar +WORKDIR /app +CMD ["obp-http4s-runner.jar"] \ No newline at end of file diff --git a/.github/Dockerfile_PreBuild_Jmx b/.github/Dockerfile_PreBuild_Jmx deleted file mode 100644 index 1fceef430a..0000000000 --- a/.github/Dockerfile_PreBuild_Jmx +++ /dev/null @@ -1,9 +0,0 @@ -FROM jetty:9.4-jdk11-alpine - -# Copy OBP source code -# Copy build artifact (.war file) into jetty from 'maven' stage. -COPY /jmx_prometheus_javaagent-0.20.0.jar /var/lib/jetty/jmx_prometheus_javaagent-0.20.0.jar -COPY /.github/jmx_exporter.config /var/lib/jetty/prometheus_config.yml -COPY /obp-api/target/obp-api-1.*.war /var/lib/jetty/webapps/ROOT.war - -CMD ["java -jar $JETTY_HOME/start.jar -javaagent:$JETTY_BASE/jmx_prometheus_javaagent-0.20.0.jar=8090:$JETTY_BASE/prometheus_config.yml"] \ No newline at end of file diff --git a/.github/workflows/build_container.yml b/.github/workflows/build_container.yml index c3ddf5a7f2..2c5fdd0a4a 100644 --- a/.github/workflows/build_container.yml +++ b/.github/workflows/build_container.yml @@ -107,10 +107,11 @@ jobs: **/target/site/surefire-report.html **/target/site/surefire-report/* - - name: Save .war artifact + - name: Save .jar artifact + continue-on-error: true run: | mkdir -p ./push - cp obp-api/target/obp-api-1.*.war ./push/ + cp obp-http4s-runner/target/obp-http4s-runner.jar ./push/ - uses: actions/upload-artifact@v4 with: name: ${{ github.sha }} diff --git a/.github/workflows/build_pull_request.yml b/.github/workflows/build_pull_request.yml index ac551c7b9d..5fc4a74074 100644 --- a/.github/workflows/build_pull_request.yml +++ b/.github/workflows/build_pull_request.yml @@ -111,10 +111,10 @@ jobs: **/target/site/surefire-report.html **/target/site/surefire-report/* - - name: Save .war artifact + - name: Save .jar artifact run: | mkdir -p ./pull - cp obp-api/target/obp-api-1.*.war ./pull/ + cp obp-http4s-runner/target/obp-http4s-runner.jar ./pull/ - uses: actions/upload-artifact@v4 with: name: ${{ github.sha }} diff --git a/obp-api/src/main/scala/bootstrap/http4s/Http4sServer.scala b/obp-api/src/main/scala/bootstrap/http4s/Http4sServer.scala index d0bb9b47f8..f25351b96c 100644 --- a/obp-api/src/main/scala/bootstrap/http4s/Http4sServer.scala +++ b/obp-api/src/main/scala/bootstrap/http4s/Http4sServer.scala @@ -12,9 +12,11 @@ object Http4sServer extends IOApp { // new bootstrap.http4s.Http4sBoot().boot new bootstrap.liftweb.Boot().boot - val port = APIUtil.getPropsAsIntValue("http4s.port",8086) - val host = APIUtil.getPropsValue("http4s.host","127.0.0.1") - + val port = APIUtil.getPropsAsIntValue("http4s.port",8080) + // Default changed from 127.0.0.1 to 0.0.0.0 so the server binds to all network interfaces. + // It is still configurable via the http4s.host property. + val host = APIUtil.getPropsValue("http4s.host","0.0.0.0") + // Use shared httpApp configuration (same as tests) val httpApp = Http4sApp.httpApp