aboutsummaryrefslogtreecommitdiffstats
path: root/Dockerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Dockerfile')
-rw-r--r--Dockerfile17
1 files changed, 13 insertions, 4 deletions
diff --git a/Dockerfile b/Dockerfile
index 03628b8..a421feb 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,4 +1,13 @@
-FROM openjdk:11-jdk-alpine
-ARG JAR_FILE=./build/libs/src.jar
-COPY ${JAR_FILE} src.jar
-ENTRYPOINT ["java", "-jar", "/src.jar"]
+FROM gradle:7.3.3-jdk11-alpine AS builder
+WORKDIR /home/springapp
+COPY --chown=gradle:gradle ./gradlew /home/springapp/
+COPY --chown=gradle:gradle ./settings.gradle.kts /home/springapp/
+COPY --chown=gradle:gradle ./build.gradle.kts /home/springapp/
+RUN gradle wrapper --no-daemon
+COPY --chown=gradle:gradle ./src /home/springapp/src
+RUN gradle bootJar --no-daemon
+
+FROM eclipse-temurin:11-jre-alpine
+WORKDIR /springapp
+COPY --from=builder /home/springapp/build/libs/src.jar ./src.jar
+ENTRYPOINT ["java", "-jar", "/springapp/src.jar"]