-
Notifications
You must be signed in to change notification settings - Fork 67
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (22 loc) · 748 Bytes
/
Dockerfile
File metadata and controls
31 lines (22 loc) · 748 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
#----------------------------------
# Stage 1
#----------------------------------
# Import docker image with maven installed
FROM maven:3.8.3-openjdk-17 as builder
# Set working directory
WORKDIR /app
# Copy source code from local to container
COPY . /app
# Build application and skip test cases
RUN mvn clean install -DskipTests=true
#--------------------------------------
# Stage 2
#--------------------------------------
# Import small size java image
FROM openjdk:17-alpine as deployer
# Copy build from stage 1 (builder)
COPY --from=builder /app/target/*.jar /app/target/bankapp.jar
# Expose application port
EXPOSE 8080
# Start the application
ENTRYPOINT ["java", "-jar", "/app/target/bankapp.jar"]