Skip to content

Commit

Permalink
Update Dockerfile-windows.multi
Browse files Browse the repository at this point in the history
  • Loading branch information
ajeetraina authored Apr 4, 2024
1 parent 68f4856 commit 2bef928
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions Dockerfile-windows.multi
Original file line number Diff line number Diff line change
@@ -1,18 +1,30 @@
# Stage 1: Build stage
FROM eclipse-temurin:21-jdk-jammy as base
RUN apt-get update && apt-get install -y dos2unix

WORKDIR /app

COPY .mvn/ .mvn
COPY mvnw pom.xml ./
RUN dos2unix mvnw pom.xml
RUN apt-get update && apt-get install -y dos2unix
RUN dos2unix ./mvnw
RUN ./mvnw dependency:resolve
COPY src ./src

# Stage 2: Development stage
FROM base as development

CMD ["./mvnw", "spring-boot:run", "-Dspring-boot.run.profiles=mysql", "-Dspring-boot.run.jvmArguments='-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:8000'"]

# Stage 3: Build stage
FROM base as build

RUN ./mvnw package

# Stage 4: Production stage
FROM eclipse-temurin:21-jre-jammy as production
EXPOSE 8080
COPY --from=0 /app/target/dependency* /app/lib
COPY --from=0 /app/target/classes /app

WORKDIR /app
EXPOSE 8080
CMD ["./mvnw", "spring-boot:run"]
COPY --from=build /app/target/spring-petclinic-*.jar /spring-petclinic.jar

CMD ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/spring-petclinic.jar"]

0 comments on commit 2bef928

Please sign in to comment.