-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from peterstadler/dev
add Docker support
- Loading branch information
Showing
4 changed files
with
176 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.gradle/ | ||
build/ | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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='<encodingDesc xmlns="http://www.tei-c.org/ns/1.0"><appInfo><application ident="DHCONVALIDATOR" version="{VERSION}"><label>DHConvalidator</label></application></appInfo></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='<publicationStmt xmlns="http://www.tei-c.org/ns/1.0"><publisher>Name, Institution</publisher><address><addrLine>Street</addrLine><addrLine>City</addrLine><addrLine>Country</addrLine><addrLine>Name</addrLine></address></publicationStmt>' \ | ||
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 <<EOF > ${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 |