Skip to content

Commit 4c3a9d8

Browse files
committed
Added Dockerfile
1 parent ab46b14 commit 4c3a9d8

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

Dockerfile

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#----------------------------------
2+
# Stage 1
3+
#----------------------------------
4+
5+
# Import docker image with maven installed
6+
FROM maven:3.8.3-openjdk-17 as builder
7+
8+
# Add maintainer, so that new user will understand who had written this Dockerfile
9+
MAINTAINER Madhup Pandey<[email protected]>
10+
11+
# Add labels to the image to filter out if we have multiple application running
12+
LABEL app=bankapp
13+
14+
# Set working directory
15+
WORKDIR /src
16+
17+
# Copy source code from local to container
18+
COPY . /src
19+
20+
# Build application and skip test cases
21+
RUN mvn clean install -DskipTests=true
22+
23+
#--------------------------------------
24+
# Stage 2
25+
#--------------------------------------
26+
27+
# Import small size java image
28+
FROM openjdk:17-alpine as deployer
29+
30+
# Copy build from stage 1 (builder)
31+
COPY --from=builder /src/target/*.jar /src/target/bankapp.jar
32+
33+
# Expose application port
34+
EXPOSE 8080
35+
36+
# Start the application
37+
ENTRYPOINT ["java", "-jar", "/src/target/bankapp.jar"]

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## End-to-End Bank Application Deployment using DevSecOps on AWS EKS
2+

pom.xml

+9
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@
7575
<groupId>org.springframework.boot</groupId>
7676
<artifactId>spring-boot-maven-plugin</artifactId>
7777
</plugin>
78+
<plugin>
79+
<groupId>org.apache.maven.plugins</groupId>
80+
<artifactId>maven-compiler-plugin</artifactId>
81+
<version>3.8.0</version>
82+
<configuration>
83+
<source>1.8</source>
84+
<target>1.8</target>
85+
</configuration>
86+
</plugin>
7887
</plugins>
7988
</build>
8089

0 commit comments

Comments
 (0)