Skip to content

Commit b10b35d

Browse files
committed
Task 21 : Define Dockerfile
1 parent b93bfb0 commit b10b35d

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

Dockerfile

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Stage 1: Build stage
2+
FROM maven:3.9.11-amazoncorretto-21 AS build
3+
4+
# Copy Maven files for dependency resolution
5+
COPY pom.xml ./
6+
COPY .mvn .mvn
7+
8+
# Copy application source code
9+
COPY src src
10+
11+
# Build the project and create the executable JAR
12+
RUN mvn clean install -DskipTests
13+
14+
# Stage 2: Run stage
15+
FROM amazoncorretto:21
16+
17+
# Set working directory
18+
WORKDIR livebetting
19+
20+
# Copy the JAR file from the build stage
21+
COPY --from=build target/*.jar livebetting.jar
22+
23+
# Expose port 5160
24+
EXPOSE 5160
25+
26+
# Set the entrypoint command for running the application
27+
ENTRYPOINT ["java", "-jar", "livebetting.jar"]

0 commit comments

Comments
 (0)