Skip to content

Commit 3615fbb

Browse files
committed
feat: Add Dockerfile🫸🌀✏️📗🐧🐳⬆
1 parent 5522638 commit 3615fbb

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Dockerfile

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM gradle:jdk22 as build
2+
3+
LABEL authors="hendisantika"
4+
# Copy the Gradle project into the image
5+
COPY --chown=gradle:gradle . /home/gradle/src
6+
WORKDIR /home/gradle/src
7+
8+
# Build the application without running tests
9+
RUN gradle build --no-daemon -x test || ./gradlew build --no-daemon -x test
10+
11+
# Use Amazon Corretto image for the runtime
12+
FROM amazoncorretto:22
13+
14+
# Copy the built JAR from the build stage
15+
WORKDIR /app
16+
COPY --from=build /home/gradle/src/build/libs/*.jar app.jar
17+
18+
# Run the application
19+
CMD ["java", "-jar", "app.jar"]

0 commit comments

Comments
 (0)