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 +