summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--build.gradle20
-rw-r--r--gradle.properties3
-rw-r--r--pom.xml22
-rw-r--r--src/main/docker/Dockerfile.jvm23
4 files changed, 53 insertions, 15 deletions
diff --git a/build.gradle b/build.gradle
index ae57661..374b627 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1,6 +1,7 @@
plugins {
id 'java'
id 'io.quarkus'
+ id "com.bmuschko.docker-remote-api" version "${dockerPluginVersion}"
id "com.diffplug.gradle.spotless" version "${spotlessPluginVersion}"
id "com.github.ben-manes.versions" version "${versionsPluginVersion}"
id "se.patrikerdes.use-latest-versions" version "${useLatestVersionsPluginVersion}"
@@ -85,8 +86,8 @@ spotless {
}
}
-group 'eu.mulk'
-version '0.1.0-SNAPSHOT'
+group "eu.mulk"
+version "${projectVersion}"
task yarnInstall(type:Exec) {
workingDir "src/main/resources/META-INF/resources"
@@ -113,3 +114,18 @@ processResources {
}
quarkusBuild.dependsOn compileWeb
+
+task buildDocker(type: com.bmuschko.gradle.docker.tasks.image.DockerBuildImage) {
+ inputDir = file(".")
+ dockerFile = file("src/main/docker/Dockerfile.jvm")
+ images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}")
+}
+
+buildDocker.dependsOn quarkusBuild
+assemble.dependsOn buildDocker
+
+task pushDocker(type: com.bmuschko.gradle.docker.tasks.image.DockerPushImage) {
+ images.add("docker.benkard.de/mulk/mulkcms2:${projectVersion}")
+}
+
+pushDocker.dependsOn buildDocker
diff --git a/gradle.properties b/gradle.properties
index d7dc937..f607976 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -1,3 +1,5 @@
+projectVersion = 0.1.0-SNAPSHOT
+
quarkusPlatformGroupId = io.quarkus
#quarkusPlatformArtifactId = quarkus-universe-bom
@@ -9,6 +11,7 @@ quarkusPluginVersion = 1.2.0.Final
#quarkusPlatformVersion = 999-SNAPSHOT
#quarkusPluginVersion = 999-SNAPSHOT
+dockerPluginVersion = 6.1.3
spotlessPluginVersion = 3.27.1
versionsPluginVersion = 0.27.0
useLatestVersionsPluginVersion = 0.2.13
diff --git a/pom.xml b/pom.xml
index 3fcdc0d..a20aed5 100644
--- a/pom.xml
+++ b/pom.xml
@@ -17,6 +17,7 @@
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
+ <dockerfile-plugin.version>1.4.13</dockerfile-plugin.version>
<quarkus-plugin.version>1.2.0.Final</quarkus-plugin.version>
<surefire-plugin.version>3.0.0-M4</surefire-plugin.version>
<spotless-plugin.version>1.26.1</spotless-plugin.version>
@@ -291,6 +292,27 @@
</java>
</configuration>
</plugin>
+
+ <plugin>
+ <groupId>com.spotify</groupId>
+ <artifactId>dockerfile-maven-plugin</artifactId>
+ <version>${dockerfile-plugin.version}</version>
+ <executions>
+ <execution>
+ <id>default</id>
+ <goals>
+ <goal>build</goal>
+ <goal>push</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <dockerfile>src/main/docker/Dockerfile.jvm</dockerfile>
+ <repository>docker.benkard.de/mulk/mulkcms2</repository>
+ <tag>${project.version}</tag>
+ </configuration>
+ </plugin>
+
</plugins>
<resources>
diff --git a/src/main/docker/Dockerfile.jvm b/src/main/docker/Dockerfile.jvm
index c7ff48c..5c726c5 100644
--- a/src/main/docker/Dockerfile.jvm
+++ b/src/main/docker/Dockerfile.jvm
@@ -7,28 +7,25 @@
#
# Then, build the image with:
#
-# docker build -f src/main/docker/Dockerfile.jvm -t quarkus/mulkcms2-jvm .
+# docker build -f src/main/docker/Dockerfile.jvm -t docker.benkard.de/mulk/mulkcms2 .
#
# Then run the container using:
#
-# docker run -i --rm -p 8080:8080 quarkus/mulkcms2-jvm
+# docker run -i --rm -p 8080:8080 docker.benkard.de/mulk/mulkcms2
#
###
-FROM fabric8/java-alpine-openjdk8-jre:1.6.5
-ENV JAVA_OPTIONS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
-ENV AB_ENABLED=jmx_exporter
+FROM adoptopenjdk:13-jre-hotspot
-# Be prepared for running in OpenShift too
-RUN adduser -G root --no-create-home --disabled-password 1001 \
- && chown -R 1001 /deployments \
+RUN mkdir -p /deployments
+
+RUN useradd --user-group --uid 1200 java \
+ && chown -R java /deployments \
&& chmod -R "g+rwX" /deployments \
- && chown -R 1001:root /deployments
+ && chown -R java:java /deployments
COPY build/lib/* /deployments/lib/
COPY build/*-runner.jar /deployments/app.jar
EXPOSE 8080
-# run with user 1001
-USER 1001
-
-ENTRYPOINT [ "/deployments/run-java.sh" ] \ No newline at end of file
+USER java
+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"]