From c3abb4d7240b5dc3927a843229b9bf10a09984a8 Mon Sep 17 00:00:00 2001 From: chandrasegar Date: Mon, 4 Mar 2024 10:54:48 +0530 Subject: [PATCH] docker file added --- Dockerfile | 15 +++++++++++++++ pom.xml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..918deca --- /dev/null +++ b/Dockerfile @@ -0,0 +1,15 @@ +FROM maven:3.6.3-openjdk-17-slim as BUILDER +ARG VERSION=0.0.1-SNAPSHOT +WORKDIR /build/ +COPY pom.xml /build/ +COPY src /build/src + +RUN mvn clean install +COPY target/mailsender-${VERSION}.jar target/application.jar + +FROM java:21.0.2-jre-slim +WORKDIR /app/ + +COPY --from=BUILDER /build/target/application.jar /app/ +CMD java -jar /app/application.jar + diff --git a/pom.xml b/pom.xml index 357401d..4b329ed 100644 --- a/pom.xml +++ b/pom.xml @@ -61,7 +61,7 @@ org.springframework.boot spring-boot-maven-plugin - 2.6.4 +