Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 1 | #### |
| 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 Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 10 | # docker build -f src/main/docker/Dockerfile.jvm -t docker.benkard.de/mulk/mulkcms2 . |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 11 | # |
| 12 | # Then run the container using: |
| 13 | # |
Matthias Andreas Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 14 | # docker run -i --rm -p 8080:8080 docker.benkard.de/mulk/mulkcms2 |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 15 | # |
| 16 | ### |
Matthias Andreas Benkard | 94f70b5 | 2020-04-13 20:57:33 +0200 | [diff] [blame] | 17 | FROM adoptopenjdk:14-jre-hotspot |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 18 | |
Matthias Andreas Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 19 | RUN mkdir -p /deployments |
| 20 | |
| 21 | RUN useradd --user-group --uid 1200 java \ |
| 22 | && chown -R java /deployments \ |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 23 | && chmod -R "g+rwX" /deployments \ |
Matthias Andreas Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 24 | && chown -R java:java /deployments |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 25 | |
Matthias Andreas Benkard | 1c97368 | 2020-04-13 20:27:13 +0200 | [diff] [blame] | 26 | COPY target/lib/* /deployments/lib/ |
| 27 | COPY target/*-runner.jar /deployments/app.jar |
Matthias Andreas Benkard | 4c5847b | 2020-01-12 15:42:02 +0100 | [diff] [blame] | 28 | EXPOSE 8080 |
| 29 | |
Matthias Andreas Benkard | f7bf7c4 | 2020-01-28 22:31:12 +0100 | [diff] [blame] | 30 | USER java |
| 31 | ENTRYPOINT ["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"] |