Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: trying jvm mode to see metrics #87

Merged
merged 5 commits into from
Aug 29, 2024
Merged
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 32 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,44 @@ COPY src /code/src
RUN ./mvnw versions:set -DnewVersion=${APP_VERSION} -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true && \
./mvnw versions:commit -f pom.xml -DskipTests -Dtests.skip=true -Dskip.unit.tests=true

RUN ./mvnw package -Pnative -DskipTests
#RUN ./mvnw package -DskipTests for JVM mode
### NATIVE BUILD
#RUN ./mvnw package -Pnative -DskipTests

### JVM BUILD
RUN ./mvnw package -DskipTests
HEALTHCHECK --interval=300s --timeout=30s CMD ./mvnw --version || exit 1
###
FROM quay.io/quarkus/quarkus-micro-image:2.0 as deploy
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 quay.io/quarkus/quarkus-micro-image:2.0 as deploy
#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
#####
FROM registry.access.redhat.com/ubi8/openjdk-21:1.19

#ENV LANGUAGE='en_US:en'
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 --from=build /code/target/quarkus-app/lib/ /deployments/lib/
#COPY --chown=185 --from=build /code/target/quarkus-app/*.jar /deployments/
#COPY --chown=185 --from=build /code/target/quarkus-app/app/ /deployments/app/
#COPY --chown=185 --from=build /code/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
#ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]
COPY --chown=185 --from=build /code/target/quarkus-app/lib/ /deployments/lib/
COPY --chown=185 --from=build /code/target/quarkus-app/*.jar /deployments/
COPY --chown=185 --from=build /code/target/quarkus-app/app/ /deployments/app/
COPY --chown=185 --from=build /code/target/quarkus-app/quarkus/ /deployments/quarkus/

EXPOSE 8080
USER 185
ENV JAVA_OPTS_APPEND="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/deployments/quarkus-run.jar"

ENTRYPOINT [ "/opt/jboss/container/java/run/run-java.sh" ]