diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..4cb9249
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,3 @@
+.gradle/
+build/
+.git
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..220a767
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,49 @@
+# First step: build the war file
+FROM gradle:5.4 as builder
+
+WORKDIR /home/gradle/dhconvalidator
+USER root:root
+COPY . .
+RUN gradle war
+
+# step 2: run the application server
+FROM jetty:alpine
+
+#base_url=http://adho.org/dhconvalidator-2018
+#paperProviderClass=org.adho.dhconvalidator.conftool.ConfToolClient
+#userProviderClass=org.adho.dhconvalidator.conftool.ConfToolClient
+ENV dhconvalidator_base_url=http://localhost:8080/dhconv \
+ dhconvalidator_conftool_login_url=https://www.conftool.pro/dh2018/ \
+ dhconvalidator_conftool_rest_url=https://www.conftool.pro/dh2018/rest.php \
+ dhconvalidator_conftool_shared_pass=quae4EeCh8iepaisoay2gei9wai3Eiz5uyaig1Daisie5ho4caxab8ahraeChaiz \
+ dhconvalidator_defaultSubmissionLanguage=ENGLISH \
+ dhconvalidator_encodingDesc='' \
+ dhconvalidator_html_address_generation=true \
+ dhconvalidator_html_to_xml_link=true \
+ dhconvalidator_image_min_resolution_height=50 \
+ dhconvalidator_image_min_resolution_width=800 \
+ dhconvalidator_logConversionStepOutput=false \
+ dhconvalidator_oxgarage_url=https://oxgarage.tei-c.org/ege-webservice/ \
+ dhconvalidator_paperProviderClass=org.adho.dhconvalidator.demo.DemoPaperProvider \
+ dhconvalidator_performSchemaValidation=true \
+ dhconvalidator_publicationStmt='Name, InstitutionStreetCityCountryName' \
+ dhconvalidator_showOnlyAcceptedPapers=false \
+ dhconvalidator_showOnlyAcceptedUsers=false \
+ dhconvalidator_tei_image_location=/Pictures \
+ dhconvalidator_templateFileDE=template/DH_template_DH2018_de \
+ dhconvalidator_templateFileEN=template/DH_template_DH2018_en \
+ dhconvalidator_templateFileES=template/DH_template_DH2018_es \
+ dhconvalidator_userProviderClass=org.adho.dhconvalidator.demo.DemoUserProvider
+
+COPY --from=builder /home/gradle/dhconvalidator/build/libs/*.war /tmp/
+COPY entrypoint.sh /entrypoint.sh
+
+USER root:root
+RUN mkdir -p ${JETTY_BASE}/webapps/ROOT \
+ && unzip /tmp/*.war -d ${JETTY_BASE}/webapps/ROOT \
+ && chown -R jetty:jetty ${JETTY_BASE}/webapps/ROOT
+
+USER jetty:jetty
+
+ENTRYPOINT ["/entrypoint.sh"]
+CMD ["java","-jar","/usr/local/jetty/start.jar"]
\ No newline at end of file
diff --git a/README.md b/README.md
index 856fe9e..e5d9ad6 100644
--- a/README.md
+++ b/README.md
@@ -4,7 +4,7 @@
[ADHO/dhconvalidator](https://github.com/ADHO/dhconvalidator)
The goal of the DHConvalidator is a simplification of the creation of a
-consistent [TEI] (http://www.tei-c.org) text base of Digital Humanities
+consistent [TEI](http://www.tei-c.org) text base of Digital Humanities
(DH) conference abstracts for further processing like the generation of
the book of abstracts. The idea was to offer the user the possibility to
edit the final version of the submission with her tool of choice
@@ -12,8 +12,8 @@ starting with two of the most popular systems Libre Office and Microsoft
Word.
The DHConvalidator works together with the conference management tool
-[ConfTool] (http://www.conftool.net/) and uses [OxGarage]
-(http://www.tei-c.org/oxgarage/) to do the bulk conversion.
+[ConfTool](http://www.conftool.net/) and
+uses [OxGarage](https://oxgarage.tei-c.org/) to do the bulk conversion.
The submission of the final version is composed of four steps after
logging in:
@@ -40,8 +40,8 @@ create a WAR file yourself and extract it to a Servlet container (Jetty
Copy the dhconvalidator.properties.example to dhconvalidator.properties
and edit it as needed:
- Set the ConfTool REST interface settings like URL and shared password.
-- Set the OxGarage webservice URL (Note that the dhconvalidator
-- TEI/Stylesheets profile must be installed for the OxGarage webservice)
+- Set the OxGarage webservice URL (Note that the dhconvalidator
+ TEI/Stylesheets profile must be installed for the OxGarage webservice)
- Edit settings for validation, min resolution, publication statement
- and so on.
@@ -57,3 +57,81 @@ the host site:
To avoid cross site scripting issues the domain should be the same as
the domain of the host site.
+
+## Docker
+
+### Building the image
+
+With Docker installed, simply enter
+```bash
+docker build -t dhconvalidator .
+```
+
+### Running a container
+
+To run the 'dhconvalidator' image you created in the step above enter
+```bash
+docker run -d --rm -p8080:8080 --name dhconvalidator dhconvalidator
+```
+This will spin up a container with the default settings, making
+the DHConvalidator instance available at `http://localhost:8080/dhconv`.
+
+#### Parameters (and default values) available to the Docker container
+
+* dhconvalidator_base_url=`http://localhost:8080/dhconv`
+* dhconvalidator_conftool_login_url=`https://www.conftool.pro/dh2018/`
+* dhconvalidator_conftool_rest_url=`https://www.conftool.pro/dh2018/rest.php`
+* dhconvalidator_conftool_shared_pass=`some_password`
+* dhconvalidator_defaultSubmissionLanguage=`ENGLISH`
+* dhconvalidator_encodingDesc=`''`
+* dhconvalidator_html_address_generation=`true`
+* dhconvalidator_html_to_xml_link=`true`
+* dhconvalidator_image_min_resolution_height=`50`
+* dhconvalidator_image_min_resolution_width=`800`
+* dhconvalidator_logConversionStepOutput=`false`
+* dhconvalidator_oxgarage_url=`https://oxgarage.tei-c.org/ege-webservice/`
+* dhconvalidator_paperProviderClass=`org.adho.dhconvalidator.demo.DemoPaperProvider`
+* dhconvalidator_performSchemaValidation=`true`
+* dhconvalidator_publicationStmt=`'Name, InstitutionStreetCityCountryName'`
+* dhconvalidator_showOnlyAcceptedPapers=`false`
+* dhconvalidator_showOnlyAcceptedUsers=`false`
+* dhconvalidator_tei_image_location=`/Pictures`
+* dhconvalidator_templateFileDE=`template/DH_template_DH2018_de`
+* dhconvalidator_templateFileEN=`template/DH_template_DH2018_en`
+* dhconvalidator_templateFileES=`template/DH_template_DH2018_es`
+* dhconvalidator_userProviderClass=`org.adho.dhconvalidator.demo.DemoUserProvider`
+
+You can overwrite the default settings via environment variables, e.g.
+```bash
+docker run -d --rm -p8080:8080 --name dhconvalidator -e dhconvalidator_base_url=http://my.dhconvalidator.base.url dhconvalidator
+```
+will set the base url to `http://my.dhconvalidator.base.url`.
+
+### Docker-compose with OxGarage sidekick
+
+`docker-compose` allows you to easily run your own dedicated OxGarage
+instance as a sidekick to the DHConvalidator.
+
+```
+version: '3'
+
+services:
+ dhconvalidator:
+ image: dhconvalidator
+ restart: always
+ ports:
+ - "8080:8080"
+ environment:
+ dhconvalidator_base_ur: http://localhost:8080
+ dhconvalidator_oxgarage_url: http://oxgarage:8080/ege-webservice/
+ oxgarage:
+ image: teic/oxgarage
+ restart: always
+ environment:
+ WEBSERVICE_URL: http://localhost:8080/ege-webservice/
+ volumes:
+ - /your/path/to/TEI/P5:/usr/share/xml/tei/odd:ro
+ - /your/path/to/Stylesheets:/usr/share/xml/tei/stylesheet:ro
+```
+NB: You need to provide your own copy of the TEI sources and Stylesheets! (see
+https://github.com/TEIC/oxgarage for more details on how to run that container)
\ No newline at end of file
diff --git a/entrypoint.sh b/entrypoint.sh
new file mode 100755
index 0000000..e1f7fa7
--- /dev/null
+++ b/entrypoint.sh
@@ -0,0 +1,41 @@
+#!/bin/sh
+
+# this is a Docker entrypoint script that will be executed
+# for each start of a container based on that image.
+#
+# the purpose here is simply to overwrite the settings in
+# `dhconvalidator.properties` with parameters provided
+# on the command line, e.g.
+# `docker run -e dhconvalidator_base_url=http://my.dhconvalidator.base.url …`
+
+cat < ${JETTY_BASE}/webapps/ROOT/dhconvalidator.properties
+#base_url=http://adho.org/dhconvalidator-2018
+base_url=${dhconvalidator_base_url}
+conftool_login_url=${dhconvalidator_conftool_login_url}
+conftool_rest_url=${dhconvalidator_conftool_rest_url}
+conftool_shared_pass=${dhconvalidator_conftool_shared_pass}
+defaultSubmissionLanguage=${dhconvalidator_defaultSubmissionLanguage}
+encodingDesc=${dhconvalidator_encodingDesc}
+html_address_generation=${dhconvalidator_html_address_generation}
+html_to_xml_link=${dhconvalidator_html_to_xml_link}
+image_min_resolution_height=${dhconvalidator_image_min_resolution_height}
+image_min_resolution_width=${dhconvalidator_image_min_resolution_width}
+logConversionStepOutput=${dhconvalidator_logConversionStepOutput}
+oxgarage_url=${dhconvalidator_oxgarage_url}
+#paperProviderClass=org.adho.dhconvalidator.conftool.ConfToolClient
+paperProviderClass=${dhconvalidator_paperProviderClass}
+performSchemaValidation=${dhconvalidator_performSchemaValidation}
+publicationStmt=${dhconvalidator_publicationStmt}
+showOnlyAcceptedPapers=${dhconvalidator_showOnlyAcceptedPapers}
+showOnlyAcceptedUsers=${dhconvalidator_showOnlyAcceptedUsers}
+tei_image_location=${dhconvalidator_tei_image_location}
+templateFileDE=${dhconvalidator_templateFileDE}
+templateFileEN=${dhconvalidator_templateFileEN}
+templateFileES=${dhconvalidator_templateFileES}
+#userProviderClass=org.adho.dhconvalidator.conftool.ConfToolClient
+userProviderClass=${dhconvalidator_userProviderClass}
+version=1.22
+EOF
+
+# run the original jetty entrypoint script (from the jetty base image)
+exec /docker-entrypoint.sh