diff --git a/.gitignore b/.gitignore index c8a3fe1..ed473b4 100644 --- a/.gitignore +++ b/.gitignore @@ -38,4 +38,6 @@ yarn.lock # Terraform **/.terraform/ **/*.prod -**/report.json \ No newline at end of file +**/report.json + +**/.env \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index cfa03aa..44efa17 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,15 +14,7 @@ COPY --from=buildtime /build/target/*.jar application.jar RUN java -Djarmode=layertools -jar application.jar extract -FROM eclipse-temurin:17-jre@sha256:0adcf8486107fbd706de4b4fdde64c2d2e3ead4c689b2fb7ae4947010e1f00b4 - -VOLUME /tmp -WORKDIR /app - -# https://github.com/microsoft/ApplicationInsights-Java/releases -ADD --chown=spring:spring https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.6.0/applicationinsights-agent-3.6.0.jar /applicationinsights-agent.jar -COPY --chown=spring:spring docker/applicationinsights.json ./applicationinsights.json -COPY --chown=spring:spring docker/run.sh ./run.sh +FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v2.1.0@sha256:7093cd54f2beb7bdb1cca3b33cb94e06eeb5750027cdb96f7bebb274118a5629 COPY --chown=spring:spring --from=builder dependencies/ ./ COPY --chown=spring:spring --from=builder snapshot-dependencies/ ./ @@ -31,8 +23,3 @@ COPY --chown=spring:spring --from=builder snapshot-dependencies/ ./ RUN true COPY --chown=spring:spring --from=builder spring-boot-loader/ ./ COPY --chown=spring:spring --from=builder application/ ./ - -EXPOSE 8080 - -RUN chmod +x ./run.sh -ENTRYPOINT ["./run.sh"] \ No newline at end of file diff --git a/docker/applicationinsights.json b/docker/applicationinsights.json deleted file mode 100644 index b331ef9..0000000 --- a/docker/applicationinsights.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "selfDiagnostics": { - "destination": "console", - "level": "INFO" - }, - "sampling": { - "percentage": 5, - "overrides": [ - { - "telemetryType": "exception", - "percentage": 100 - }, - { - "telemetryType": "request", - "percentage": 100 - } - ] - } -} \ No newline at end of file diff --git a/docker/run.sh b/docker/run.sh deleted file mode 100644 index 32fb9fe..0000000 --- a/docker/run.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -spring_boot_version=$(cat ./META-INF/MANIFEST.MF | grep 'Spring-Boot-Version:' | cut -d ' ' -f 2) -major_version=$(echo "$spring_boot_version" | cut -d '.' -f 1) - -# Check if the major_version is 3 -if [ "$major_version" -eq "3" ] ; then - exec java -javaagent:/applicationinsights-agent.jar ${JAVA_OPTS} org.springframework.boot.loader.launch.JarLauncher "$@" -else - exec java -javaagent:/applicationinsights-agent.jar ${JAVA_OPTS} org.springframework.boot.loader.JarLauncher "$@" -fi