In this we are going to deploy banking application.
This banking application has feature like Multiple account holder, Money deposit & Withdrawl and Transaction.
This Banking App is created with springboot framework.
like in java step are first we build it with apache maven then from build we get .jar(java application runtime) file and then we deploy this jar file.
So basically it is 3 tier application we want to deploy with help of docker.

This is code repo https://github.com/Goldencat98/Bank-App fork into your github acc.
Then go to aws launch t2.medium with ubuntu Allow all in security group. get storage of 10gb.
Connect your instance with ssh.
Now lets start
Clone the code u can use your fork repo also or direct main repo of golden cat.
git clone <https://github.com/Faizan2727/Springboot-app.git>
rm Dockerfile
rm docker-compose.yml
in this code base u will see pom.xml file this file container all libraries which has to be install to run application or build applcation with mvn cmd.
if this pom.xml file is not present then u should ask for it to the developer
vim Dockerfile
#---------Stage1------------------
# Pull base image so that we can use maven to build jar files
FROM maven:3.8.3-openjdk-17 AS builder
#creating directory in container for copying src code
WORKDIR /app
#copying all the code from host to container
COPY . /app
# Build the app to generate jar file
RUN mvn clean install -DskipTests=true
#----------Stage2-------------------
FROM openjdk:17-alpine
WORKDIR /app
COPY --from=builder /app/target/*.jar /app/target/bankapp.jar
#expose the port so that the port can be mapped with the host
EXPOSE 8080
#execute the JAR file using java command and -jar for (to specify we are executing a jar file)
ENTRYPOINT ["java", "-jar", "/app/target/bankapp.jar"]
now we will build this image
docker build -t bankapp-mini .