Allow running on the Openshift platform

A few changes are necessary for the best out-of-the-box experience on Docker-based application
platforms such as OpenShift:
1. For security purposes, they run the containers as non-root. Before this change, the user was
   trying to write to the home dir, which is set to /root by default.
2. Deploy time is limited, and the download of dependencies by Jetty at start-up time, while
   convenient for testing, causes timeouts when deploying. a WAR is now created during
   Docker image creation, and as a result starting up the container is really fast now.

In addition, it is now possible to enable debug logging for Jetty by uncommenting the
relevant line in the Dockerfile.
This commit is contained in:
Clément Moyroud
2017-03-08 19:37:27 -08:00
committed by Clément Moyroud
parent 4cf9465d04
commit 163863ac0b
2 changed files with 38 additions and 3 deletions

24
pom.xml
View File

@@ -32,7 +32,7 @@
<configuration>
<scanIntervalSeconds>5</scanIntervalSeconds>
<webApp>
<contextPath>/plantuml</contextPath>
<contextPath>${jetty.contextpath}</contextPath>
</webApp>
<systemProperties>
<systemProperty>
@@ -42,6 +42,27 @@
</systemProperties>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>2.3</version>
<executions>
<execution>
<phase>package</phase>
<goals><goal>copy</goal></goals>
<configuration>
<artifactItems>
<artifactItem>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-runner</artifactId>
<version>8.1.9.v20130131</version>
<destFileName>jetty-runner.jar</destFileName>
</artifactItem>
</artifactItems>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
@@ -149,6 +170,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jetty.version>8.0.4.v20111024</jetty.version>
<jetty.port>8080</jetty.port>
<jetty.contextpath>/plantuml</jetty.contextpath>
<maven.build.timestamp.format>yyyyMMdd-HHmm
</maven.build.timestamp.format>
<timestamp>${maven.build.timestamp}</timestamp>