From b0bb8f2c4ba9d66f700a383144ecad44b07d9bd2 Mon Sep 17 00:00:00 2001 From: OMPRAKASH MISHRA Date: Fri, 13 Oct 2023 12:29:12 -0700 Subject: [PATCH] use jvm at this point. --- Dockerfile | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index f078915..ade7d86 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,17 +7,39 @@ WORKDIR /code RUN chmod +x mvnw RUN ./mvnw -B org.apache.maven.plugins:maven-dependency-plugin:3.1.2:go-offline COPY src /code/src -RUN ./mvnw package -Pnative -DskipTests +#RUN ./mvnw package -Pnative -DskipTests +RUN ./mvnw package -DskipTests HEALTHCHECK --interval=300s --timeout=30s CMD ./mvnw --version || exit 1 ### -FROM quay.io/quarkus/quarkus-micro-image:2.0 -WORKDIR /work/ -RUN chown 1001 /work \ - && chmod "g+rwX" /work \ - && chown 1001:root /work -COPY --chown=1001:root --from=build /code/target/*-runner /work/application - -EXPOSE 3000 -USER 1001 +#FROM quay.io/quarkus/quarkus-micro-image:2.0 +#WORKDIR /work/ +#RUN chown 1001 /work \ +# && chmod "g+rwX" /work \ +# && chown 1001:root /work +#COPY --chown=1001:root --from=build /code/target/*-runner /work/application + +#EXPOSE 3000 +#USER 1001 +#HEALTHCHECK --interval=300s --timeout=3s CMD curl -f http://localhost:3000/ || exit 1 +#CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] + + + + +FROM registry.access.redhat.com/ubi8/openjdk-17:1.16 + +ENV LANGUAGE='en_US:en' + + +# We make four distinct layers so if there are application changes the library layers can be re-used +COPY --chown=185 target/quarkus-app/lib/ /deployments/lib/ +COPY --chown=185 target/quarkus-app/*.jar /deployments/ +COPY --chown=185 target/quarkus-app/app/ /deployments/app/ +COPY --chown=185 target/quarkus-app/quarkus/ /deployments/quarkus/ + +EXPOSE 8080 +USER 185 +ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" +ENV JAVA_APP_JAR="/deployments/quarkus-run.jar" HEALTHCHECK --interval=300s --timeout=3s CMD curl -f http://localhost:3000/ || exit 1 -CMD ["./application", "-Dquarkus.http.host=0.0.0.0"] +ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]