-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (22 loc) · 678 Bytes
/
Dockerfile
File metadata and controls
32 lines (22 loc) · 678 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Stage 1: Build the application
FROM openjdk:17-jdk-alpine AS build
# Install Maven
RUN apk add --no-cache maven
# Set the working directory in the container
WORKDIR /app
# Copy the Maven build files
COPY pom.xml .
# Copy the source code
COPY src ./src
# Build the application
RUN mvn package -DskipTests
# Stage 2: Create the final image
FROM openjdk:17-jdk-alpine
# Set the working directory in the container
WORKDIR /app
# Copy the jar file from the build stage
COPY --from=build /app/target/*.jar app.jar
# Expose the port the application runs on
EXPOSE 8180
# Run the application with debug logging enabled
ENTRYPOINT ["java", "-jar", "/app/app.jar", "--debug"]