Nav apraksta

Dockerfile 863B

1234567891011121314151617181920212223242526272829303132
  1. ######
  2. ##
  3. ## Stage 1: Building the app
  4. ##
  5. #######
  6. FROM maven:3.8.3-adoptopenjdk-16 AS builder
  7. WORKDIR /build/
  8. COPY pom.xml /build/
  9. # fetch all dependencies
  10. #RUN mvn dependency:go-offline -B
  11. COPY src /build/src/
  12. RUN mvn package -DskipTests
  13. WORKDIR /build/target/
  14. RUN java -Djarmode=layertools -jar micro-service-risk-manager-0.0.1-SNAPSHOT.jar extract
  15. ######
  16. ##
  17. ## Stage 2: Running the app
  18. ##
  19. #######
  20. FROM adoptopenjdk:16_36-jre-hotspot
  21. RUN useradd -rm -d /home/zbook-pn-15-g3 -s /bin/bash -g root -G sudo -u 1001 simple-user
  22. USER simple-user
  23. WORKDIR application
  24. EXPOSE 8088
  25. ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]
  26. COPY --from=builder /build/target/dependencies/ ./
  27. COPY --from=builder /build/target/spring-boot-loader/ ./
  28. COPY --from=builder /build/target/snapshot-dependencies/ ./
  29. COPY --from=builder /build/target/application/ ./

Powered by TurnKey Linux.