1
0
mirror of https://github.com/octoleo/plantuml-server.git synced 2024-09-27 14:39:01 +00:00

Added docker-compose file to build plantuml-server with a custom base url.

This commit is contained in:
Michael Rausch 2019-05-07 19:06:08 +02:00
parent 3c3c64b3d6
commit e276733481
2 changed files with 30 additions and 8 deletions

View File

@ -1,12 +1,12 @@
PlantUML Server PlantUML Server
=============== ===============
[![Build Status](https://travis-ci.org/plantuml/plantuml-server.png?branch=master)](https://travis-ci.org/plantuml/plantuml-server) [![Build Status](https://travis-ci.org/plantuml/plantuml-server.png?branch=master)](https://travis-ci.org/plantuml/plantuml-server)
[![](https://images.microbadger.com/badges/image/plantuml/plantuml-server.svg)](https://microbadger.com/images/plantuml/plantuml-server "Get your own image badge on microbadger.com") [![](https://images.microbadger.com/badges/image/plantuml/plantuml-server.svg)](https://microbadger.com/images/plantuml/plantuml-server "Get your own image badge on microbadger.com")
[![Docker Pull](https://img.shields.io/docker/pulls/plantuml/plantuml-server.svg)](https://hub.docker.com/r/plantuml/plantuml-server/) [![Docker Pull](https://img.shields.io/docker/pulls/plantuml/plantuml-server.svg)](https://hub.docker.com/r/plantuml/plantuml-server/)
PlantUML Server is a web application to generate UML diagrams on-the-fly. PlantUML Server is a web application to generate UML diagrams on-the-fly.
![](https://raw.githubusercontent.com/ftomassetti/plantuml-server/readme/screenshots/screenshot.png) ![](https://raw.githubusercontent.com/ftomassetti/plantuml-server/readme/screenshots/screenshot.png)
To know more about PlantUML, please visit http://plantuml.com/. To know more about PlantUML, please visit http://plantuml.com/.
Requirements Requirements
@ -25,7 +25,7 @@ mvn jetty:run
``` ```
The server is now listing to [http://localhost:8080/plantuml](http://localhost:8080/plantuml). The server is now listing to [http://localhost:8080/plantuml](http://localhost:8080/plantuml).
In this way the server is run on an embedded jetty server. In this way the server is run on an embedded jetty server.
You can specify the port at which it runs: You can specify the port at which it runs:
@ -44,6 +44,15 @@ docker run -d -p 8080:8080 plantuml/plantuml-server:tomcat
The server is now listing to [http://localhost:8080](http://localhost:8080). The server is now listing to [http://localhost:8080](http://localhost:8080).
To run plantuml using different base url, change the `docker-compose.yml` file:
~~~
args:
BASE_URL: plantuml
~~~
And run `docker-compose up --build`. This will build a modified version of the image using
the base url `/plantuml`, e.g. http://localhost/plantuml
How to set PlantUML options How to set PlantUML options
================================= =================================
@ -80,19 +89,19 @@ You can set all the following variables:
Alternate: How to build your docker image Alternate: How to build your docker image
====================================================== ======================================================
This method uses maven to run the application. That requires internet connectivity. This method uses maven to run the application. That requires internet connectivity.
So, you can use following command to create a self-contained docker image that will "just-work". So, you can use following command to create a self-contained docker image that will "just-work".
*Note: Generate the WAR (instructions further below) prior to running "docker build"* *Note: Generate the WAR (instructions further below) prior to running "docker build"*
``` ```
docker image build -t plantuml-server . docker image build -t plantuml-server .
docker run -d -p 8080:8080 plantuml-server docker run -d -p 8080:8080 plantuml-server
``` ```
The server is now listing to [http://localhost:8080/plantuml](http://localhost:8080/plantuml). The server is now listing to [http://localhost:8080/plantuml](http://localhost:8080/plantuml).
You may specify the port in `-p` Docker command line argument. You may specify the port in `-p` Docker command line argument.
How to generate the war How to generate the war
======================= =======================

13
docker-compose.yml Normal file
View File

@ -0,0 +1,13 @@
version: '3.3'
services:
plantuml-server:
build:
context: .
dockerfile: Dockerfile.jetty
args:
BASE_URL: plantuml
image: plantuml/plantuml-server:local
container_name: plantuml-server
ports:
- 8080:8080