FROM amazoncorretto:17-alpine3.16 as builder LABEL author="Piotr Biernat" LABEL service="api-gw" LABEL vendor="Egommerce" LABEL version="1.0" RUN mkdir /app WORKDIR /app COPY apigw . RUN ./mvnw clean compile install FROM amazoncorretto:17-alpine3.16 #ENV CA_CERT_DIR /usr/lib/jvm/java-8-amazon-corretto/lib/security COPY --from=builder /app/target/apigw-dev-jar-with-dependencies.jar /api-gw.jar # Add own ca to cacert trusted db #COPY --from=builder /app/src/main/resources/ca.pem /tmp/ca.pem #RUN keytool -import -trustcacerts -keystore ${CA_CERT_DIR}/cacerts \ # -storepass changeit -noprompt -alias mycert -file /tmp/ca.pem && \ # rm /tmp/ca.pem # "-Djavax.net.debug=all", ENTRYPOINT ["java", "-Xmx1g", "-Djava.security.egd=file:/dev/./urandom", "-jar", "/api-gw.jar", "--spring.profiles.active=docker"] EXPOSE 443