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 | # |
| 10 | # docker build -f src/main/docker/Dockerfile.jvm -t quarkus/mulkcms2-jvm . |
| 11 | # |
| 12 | # Then run the container using: |
| 13 | # |
| 14 | # docker run -i --rm -p 8080:8080 quarkus/mulkcms2-jvm |
| 15 | # |
| 16 | ### |
| 17 | FROM fabric8/java-alpine-openjdk8-jre:1.6.5 |
| 18 | ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager" |
| 19 | ENV AB_ENABLED=jmx_exporter |
| 20 | |
| 21 | # Be prepared for running in OpenShift too |
| 22 | RUN adduser -G root --no-create-home --disabled-password 1001 \ |
| 23 | && chown -R 1001 /deployments \ |
| 24 | && chmod -R "g+rwX" /deployments \ |
| 25 | && chown -R 1001:root /deployments |
| 26 | |
| 27 | COPY build/lib/* /deployments/lib/ |
| 28 | COPY build/*-runner.jar /deployments/app.jar |
| 29 | EXPOSE 8080 |
| 30 | |
| 31 | # run with user 1001 |
| 32 | USER 1001 |
| 33 | |
| 34 | ENTRYPOINT [ "/deployments/run-java.sh" ] |