From c0bf98ea69183097797eafa859f10cd2fc911da4 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Mon, 17 Mar 2025 11:33:56 +0000 Subject: [PATCH] added_new_dockerfile --- .Dockerfile.swp | Bin 0 -> 12288 bytes Dockerfile | 45 +++++++++------------------------------------ 2 files changed, 9 insertions(+), 36 deletions(-) create mode 100644 .Dockerfile.swp diff --git a/.Dockerfile.swp b/.Dockerfile.swp new file mode 100644 index 0000000000000000000000000000000000000000..5cd53cd814a93f4d110f1820632b2b73be29c82f GIT binary patch literal 12288 zcmeI%y^exF5Ww-#>SAIv=L?|Lh>L|E-5DDTD}z1UArcif1g^Y$O&`SC$VM$`>`49- zmd#Gs$?)qo8;p1BjWr)BDWhv%kN9Yb6hV>X#Vb=i$J$m?*PbZzsQIkw%fClKCyMh! z5jb0&#Yq&TX>Kq5AhQseFz|c z00IagfB*srAW%brTsP#u?7R8wy-_jO@YiS=0R#|0009ILKmY**5I_I{1fBx^kI1DX uaxI6s|9_qT&H83?1Of;kfB*srAb+JuA$wKaph9)fl literal 0 HcmV?d00001 diff --git a/Dockerfile b/Dockerfile index 079acabe..28c1e21e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,37 +1,10 @@ -#---------------------------------- -# Stage 1 -#---------------------------------- +FROM maven:3.9.6-eclipse-temurin-17-alpine AS builder #new base image added +workdir /app +copy . . +run mvn clean install -DskipTests=true +from openjdk:17-slim +workdir /app +COPY --from=builder /app/target/*.jar /app/app.jar +expose 8080 +cmd ["java","-jar","/app/app.jar"] -# Import docker image with maven installed -FROM maven:3.8.3-openjdk-17 as builder - -# Add maintainer, so that new user will understand who had written this Dockerfile -MAINTAINER Madhup Pandey - -# Add labels to the image to filter out if we have multiple application running -LABEL app=bankapp - -# Set working directory -WORKDIR /src - -# Copy source code from local to container -COPY . /src - -# 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 /src/target/*.jar /src/target/bankapp.jar - -# Expose application port -EXPOSE 8080 - -# Start the application -ENTRYPOINT ["java", "-jar", "/src/target/bankapp.jar"]