blob: 3cfb94703474b8e71fa2f37689f003b8ae02cebc [file] [log] [blame]
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +01001####
2# This Dockerfile is used in order to build a container that runs the Quarkus application in JVM mode
3#
4# Before building the docker image run:
5#
6# mvn package
7#
8# Then, build the image with:
9#
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +010010# docker build -f src/main/docker/Dockerfile.jvm -t docker.benkard.de/mulk/mulkcms2 .
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010011#
12# Then run the container using:
13#
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +010014# docker run -i --rm -p 8080:8080 docker.benkard.de/mulk/mulkcms2
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010015#
16###
Matthias Andreas Benkard94f70b52020-04-13 20:57:33 +020017FROM adoptopenjdk:14-jre-hotspot
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010018
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +010019RUN mkdir -p /deployments
20
21RUN useradd --user-group --uid 1200 java \
22 && chown -R java /deployments \
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010023 && chmod -R "g+rwX" /deployments \
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +010024 && chown -R java:java /deployments
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010025
Matthias Andreas Benkard1c973682020-04-13 20:27:13 +020026COPY target/lib/* /deployments/lib/
27COPY target/*-runner.jar /deployments/app.jar
Matthias Andreas Benkard4c5847b2020-01-12 15:42:02 +010028EXPOSE 8080
29
Matthias Andreas Benkardf7bf7c42020-01-28 22:31:12 +010030USER java
31ENTRYPOINT ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseShenandoahGC", "-XX:ShenandoahGCHeuristics=compact", "-Dquarkus.http.host=0.0.0.0", "-Djava.util.logging.manager=org.jboss.logmanager.LogManager", "-jar", "/deployments/app.jar"]