Skip to content

Commit

Permalink
docker image improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
LeonardoMeireles55 committed Jan 20, 2025
1 parent f966b5c commit fa0dcfb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
11 changes: 6 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
FROM maven:3.9.8-eclipse-temurin-21 AS build
FROM eclipse-temurin:21-jdk-alpine AS build

COPY src /app/src
COPY pom.xml /app

WORKDIR /app
RUN mvn clean package -DskipTests -U
RUN mvn clean package -DskipTests -U \
&& rm -rf /root/.m2

FROM openjdk:21
WORKDIR /usr/src/app
FROM eclipse-temurin:21-jre-alpine

COPY --from=build app/target/QualityLabPro-0.7.jar app.jar
WORKDIR /app
COPY --from=build /app/target/QualityLabPro-0.7.jar app.jar
12 changes: 12 additions & 0 deletions Dockerfile_OLD
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM maven:3.9.8-eclipse-temurin-21 AS build

COPY src /app/src
COPY pom.xml /app

WORKDIR /app
RUN mvn clean package -DskipTests -U

FROM openjdk:21
WORKDIR /usr/src/app

COPY --from=build app/target/QualityLabPro-0.7.jar app.jar

0 comments on commit fa0dcfb

Please sign in to comment.