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 0a9bbbd commit d08f632
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
FROM eclipse-temurin:21-jdk-alpine AS build

RUN apk add --no-cache maven

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

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

# Run stage
FROM eclipse-temurin:21-jre-alpine

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

ENV SPRING_PROFILES_ACTIVE=prod \
SERVER_PORT=8080

EXPOSE ${SERVER_PORT}

0 comments on commit d08f632

Please sign in to comment.