diff --git a/.travis.yml b/.travis.yml index f5c99a7..7b38b2f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1 +1,16 @@ -language: java \ No newline at end of file +language: java + +sudo: required + +services: + - docker + +script: + - mvn package + +after_success: + - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD + - if [ "$TRAVIS_BRANCH" == "master" ]; then + docker build -t plantuml/plantuml-server:latest . ; + docker push plantuml/plantuml-server:latest; + fi diff --git a/Dockerfile b/Dockerfile index a89fb39..9aa20d2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,20 +1,8 @@ -FROM maven:3-jdk-8 +FROM jetty +MAINTAINER D.Ducatel -RUN apt-get update && apt-get install -y --no-install-recommends graphviz fonts-wqy-zenhei && rm -rf /var/lib/apt/lists/* +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 +ADD target/plantuml.war /var/lib/jetty/webapps/ROOT.war \ No newline at end of file diff --git a/README.md b/README.md index 962eedd..b6110cd 100644 --- a/README.md +++ b/README.md @@ -36,13 +36,10 @@ How to run the server with Docker ================================= ``` -docker build -t plantuml-server . -docker run -d -p 8080:8080 plantuml-server +docker run -d -p 8080:8080 plantuml/plantuml-server ``` -The server is now listing to [http://localhost:8080/plantuml](http://localhost:8080/plantuml). - -You may specity the port in `-p` Docker command line argument. +The server is now listing to [http://localhost:8080](http://localhost:8080). Alternate: How to run the server with Tomcat + Docker? ======================================================