Dockerfile 737 B

123456789101112131415161718192021
  1. # FROM maven:3-eclipse-temurin-17-alpine as builder
  2. FROM maven:3.8.4-openjdk-11-slim AS builder
  3. ARG JAVA_OPTS
  4. ENV JAVA_OPTS=$JAVA_OPTS
  5. WORKDIR /app
  6. VOLUME [ "/app" ]
  7. COPY . /app
  8. RUN mvn clean package -DskipTests
  9. FROM openjdk:8-jdk-alpine as runner
  10. VOLUME /tmp
  11. ARG JAVA_OPTS
  12. ENV JAVA_OPTS=$JAVA_OPTS
  13. WORKDIR /app2
  14. # COPY target/swagger-demo-0.0.1-SNAPSHOT.jar workspace.jar
  15. COPY --from=builder /app/target/swagger-demo-0.0.1-SNAPSHOT.jar .
  16. EXPOSE 8080
  17. # ENTRYPOINT exec java $JAVA_OPTS -jar swagger-demo-0.0.1-SNAPSHOT.jar
  18. # For Spring-Boot project, use the entrypoint below to reduce Tomcat startup time.
  19. ENTRYPOINT exec java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar swagger-demo-0.0.1-SNAPSHOT.jar