1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-12-22 08:48:54 +00:00
plantuml-server/Dockerfile
Clément Moyroud 163863ac0b 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.
2017-04-25 16:18:11 -07:00

21 lines
685 B
Docker

FROM maven:3-jdk-8
RUN apt-get update && apt-get install -y --no-install-recommends graphviz fonts-wqy-zenhei && rm -rf /var/lib/apt/lists/*
COPY pom.xml /app/
COPY src /app/src/
ENV MAVEN_CONFIG=/app/.m2
WORKDIR /app
RUN mvn package
# chmod required to ensure any user can run the app
RUN mkdir /app/.m2 && chmod -R a+w /app
EXPOSE 8080
ENV HOME /app
CMD java -Djetty.contextpath=/ -jar target/dependency/jetty-runner.jar target/plantuml.war
# To run with debugging enabled instead
#CMD java -Dorg.eclipse.jetty.util.log.class=org.eclipse.jetty.util.log.StdErrLog -Dorg.eclipse.jetty.LEVEL=DEBUG -Djetty.contextpath=/ -jar target/dependency/jetty-runner.jar target/plantuml.war