Skip to content

Commit

Permalink
Merge pull request #35 from pagopa/PAGOPA-1481-sviluppo-upgrade-ai-wi…
Browse files Browse the repository at this point in the history
…th-java-17

PAGOPA-1481 fixing dockerfile for app insights
  • Loading branch information
FedericoRuzzier authored Feb 7, 2024
2 parents da793b9 + 052850b commit 37c6e76
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 24 deletions.
28 changes: 11 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,21 @@
#
# Build
#
FROM maven:3.9.5-amazoncorretto-17-al2023@sha256:eeaa7ab572d931f7273fc5cf31429923f172091ae388969e11f42ec6dd817d74 as buildtime
FROM maven:3.9.3-amazoncorretto-17@sha256:4ab7db7bd5f95e58b0ba1346ff29d6abdd9b73e5fd89c5140edead8b037386ff AS buildtime

WORKDIR /build
COPY . .
RUN mvn clean package -Dmaven.test.skip=true

RUN mvn clean package -DskipTests

FROM amazoncorretto:17.0.9-alpine3.18@sha256:df48bf2e183230040890460ddb4359a10aa6c7aad24bd88899482c52053c7e17 as builder
COPY --from=buildtime /build/target/*.jar application.jar
RUN java -Djarmode=layertools -jar application.jar extract
FROM amazoncorretto:17.0.8-alpine3.18@sha256:0c61f12abfb091be48474e836e6802ff3a93e8e038e0460af8c7f447ccbd3901 AS runtime

VOLUME /tmp
WORKDIR /app

FROM ghcr.io/pagopa/docker-base-springboot-openjdk17:v1.1.0@sha256:6fa320d452fa22066441f1ef292d15eb06f944bc8bca293e1a91ea460d30a613
ADD --chown=spring:spring https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases/download/v1.25.1/opentelemetry-javaagent.jar .
COPY --from=buildtime /build/target/*.jar /app/app.jar
# The agent is enabled at runtime via JAVA_TOOL_OPTIONS.
ADD https://github.com/microsoft/ApplicationInsights-Java/releases/download/3.4.15/applicationinsights-agent-3.4.15.jar /app/applicationinsights-agent.jar

COPY --chown=spring:spring --from=builder dependencies/ ./
COPY --chown=spring:spring --from=builder snapshot-dependencies/ ./
# https://github.com/moby/moby/issues/37965#issuecomment-426853382
RUN true
COPY --chown=spring:spring --from=builder spring-boot-loader/ ./
COPY --chown=spring:spring --from=builder application/ ./
RUN chown -R nobody:nobody /app

EXPOSE 8080

ENTRYPOINT ["java","-javaagent:opentelemetry-javaagent.jar","--enable-preview","org.springframework.boot.loader.JarLauncher"]
ENTRYPOINT [ "java","-jar","/app/app.jar" ]
4 changes: 2 additions & 2 deletions helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ apiVersion: v2
name: pagopa-afm-utils
description: Utility microservice for pagoPA AFM
type: application
version: 0.21.0
appVersion: 0.9.2
version: 0.22.0
appVersion: 0.9.2-1-PAGOPA-1481-sviluppo-upgrade-ai-with-java-17
dependencies:
- name: microservice-chart
version: 2.4.0
Expand Down
2 changes: 1 addition & 1 deletion helm/values-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-afm-utils
tag: "0.9.2"
tag: "0.9.2-1-PAGOPA-1481-sviluppo-upgrade-ai-with-java-17"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-afm-utils
tag: "0.9.2"
tag: "0.9.2-1-PAGOPA-1481-sviluppo-upgrade-ai-with-java-17"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion helm/values-uat.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ microservice-chart:
fullnameOverride: ""
image:
repository: ghcr.io/pagopa/pagopa-afm-utils
tag: "0.9.2"
tag: "0.9.2-1-PAGOPA-1481-sviluppo-upgrade-ai-with-java-17"
pullPolicy: Always
livenessProbe:
httpGet:
Expand Down
2 changes: 1 addition & 1 deletion openapi/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"title": "afm-utils",
"description": "@project.description@",
"termsOfService": "https://www.pagopa.gov.it/",
"version": "0.9.2"
"version": "0.9.2-1-PAGOPA-1481-sviluppo-upgrade-ai-with-java-17"
},
"servers": [
{
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

<groupId>it.gov.pagopa</groupId>
<artifactId>afm-utils</artifactId>
<version>0.9.2</version>
<version>0.9.2-1-PAGOPA-1481-sviluppo-upgrade-ai-with-java-17</version>
<name>afm-utils</name>
<description>Utility microservice for pagoPA AFM</description>
<packaging>jar</packaging>
Expand Down

0 comments on commit 37c6e76

Please sign in to comment.