From 66ace572bfb23c520655f6f5af252c0feb8030a6 Mon Sep 17 00:00:00 2001 From: Christian Autermann Date: Thu, 16 May 2019 15:51:53 +0200 Subject: [PATCH 1/5] replaced LICENSE.md with plain text version --- LICENSE | 203 +++++++++++++++++++++++++++++++++++++++++++++++++++++ LICENSE.md | 194 -------------------------------------------------- 2 files changed, 203 insertions(+), 194 deletions(-) create mode 100644 LICENSE delete mode 100644 LICENSE.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 00000000..f082271e --- /dev/null +++ b/LICENSE @@ -0,0 +1,203 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright (C) 2013 by 52 North Initiative for Geospatial Open + Source Software GmbH + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/LICENSE.md b/LICENSE.md deleted file mode 100644 index d0af96c3..00000000 --- a/LICENSE.md +++ /dev/null @@ -1,194 +0,0 @@ -Apache License -============== - -_Version 2.0, January 2004_ -_<>_ - -### Terms and Conditions for use, reproduction, and distribution - -#### 1. Definitions - -“License” shall mean the terms and conditions for use, reproduction, and -distribution as defined by Sections 1 through 9 of this document. - -“Licensor” shall mean the copyright owner or entity authorized by the copyright -owner that is granting the License. - -“Legal Entity” shall mean the union of the acting entity and all other entities -that control, are controlled by, or are under common control with that entity. -For the purposes of this definition, “control” means **(i)** the power, direct or -indirect, to cause the direction or management of such entity, whether by -contract or otherwise, or **(ii)** ownership of fifty percent (50%) or more of the -outstanding shares, or **(iii)** beneficial ownership of such entity. - -“You” (or “Your”) shall mean an individual or Legal Entity exercising -permissions granted by this License. - -“Source” form shall mean the preferred form for making modifications, including -but not limited to software source code, documentation source, and configuration -files. - -“Object” form shall mean any form resulting from mechanical transformation or -translation of a Source form, including but not limited to compiled object code, -generated documentation, and conversions to other media types. - -“Work” shall mean the work of authorship, whether in Source or Object form, made -available under the License, as indicated by a copyright notice that is included -in or attached to the work (an example is provided in the Appendix below). - -“Derivative Works” shall mean any work, whether in Source or Object form, that -is based on (or derived from) the Work and for which the editorial revisions, -annotations, elaborations, or other modifications represent, as a whole, an -original work of authorship. For the purposes of this License, Derivative Works -shall not include works that remain separable from, or merely link (or bind by -name) to the interfaces of, the Work and Derivative Works thereof. - -“Contribution” shall mean any work of authorship, including the original version -of the Work and any modifications or additions to that Work or Derivative Works -thereof, that is intentionally submitted to Licensor for inclusion in the Work -by the copyright owner or by an individual or Legal Entity authorized to submit -on behalf of the copyright owner. For the purposes of this definition, -“submitted” means any form of electronic, verbal, or written communication sent -to the Licensor or its representatives, including but not limited to -communication on electronic mailing lists, source code control systems, and -issue tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding communication -that is conspicuously marked or otherwise designated in writing by the copyright -owner as “Not a Contribution.” - -“Contributor” shall mean Licensor and any individual or Legal Entity on behalf -of whom a Contribution has been received by Licensor and subsequently -incorporated within the Work. - -#### 2. Grant of Copyright License - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable copyright license to reproduce, prepare Derivative Works of, -publicly display, publicly perform, sublicense, and distribute the Work and such -Derivative Works in Source or Object form. - -#### 3. Grant of Patent License - -Subject to the terms and conditions of this License, each Contributor hereby -grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, -irrevocable (except as stated in this section) patent license to make, have -made, use, offer to sell, sell, import, and otherwise transfer the Work, where -such license applies only to those patent claims licensable by such Contributor -that are necessarily infringed by their Contribution(s) alone or by combination -of their Contribution(s) with the Work to which such Contribution(s) was -submitted. If You institute patent litigation against any entity (including a -cross-claim or counterclaim in a lawsuit) alleging that the Work or a -Contribution incorporated within the Work constitutes direct or contributory -patent infringement, then any patent licenses granted to You under this License -for that Work shall terminate as of the date such litigation is filed. - -#### 4. Redistribution - -You may reproduce and distribute copies of the Work or Derivative Works thereof -in any medium, with or without modifications, and in Source or Object form, -provided that You meet the following conditions: - -* **(a)** You must give any other recipients of the Work or Derivative Works a copy of -this License; and -* **(b)** You must cause any modified files to carry prominent notices stating that You -changed the files; and -* **(c)** You must retain, in the Source form of any Derivative Works that You distribute, -all copyright, patent, trademark, and attribution notices from the Source form -of the Work, excluding those notices that do not pertain to any part of the -Derivative Works; and -* **(d)** If the Work includes a “NOTICE” text file as part of its distribution, then any -Derivative Works that You distribute must include a readable copy of the -attribution notices contained within such NOTICE file, excluding those notices -that do not pertain to any part of the Derivative Works, in at least one of the -following places: within a NOTICE text file distributed as part of the -Derivative Works; within the Source form or documentation, if provided along -with the Derivative Works; or, within a display generated by the Derivative -Works, if and wherever such third-party notices normally appear. The contents of -the NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative Works that -You distribute, alongside or as an addendum to the NOTICE text from the Work, -provided that such additional attribution notices cannot be construed as -modifying the License. - -You may add Your own copyright statement to Your modifications and may provide -additional or different license terms and conditions for use, reproduction, or -distribution of Your modifications, or for any such Derivative Works as a whole, -provided Your use, reproduction, and distribution of the Work otherwise complies -with the conditions stated in this License. - -#### 5. Submission of Contributions - -Unless You explicitly state otherwise, any Contribution intentionally submitted -for inclusion in the Work by You to the Licensor shall be under the terms and -conditions of this License, without any additional terms or conditions. -Notwithstanding the above, nothing herein shall supersede or modify the terms of -any separate license agreement you may have executed with Licensor regarding -such Contributions. - -#### 6. Trademarks - -This License does not grant permission to use the trade names, trademarks, -service marks, or product names of the Licensor, except as required for -reasonable and customary use in describing the origin of the Work and -reproducing the content of the NOTICE file. - -#### 7. Disclaimer of Warranty - -Unless required by applicable law or agreed to in writing, Licensor provides the -Work (and each Contributor provides its Contributions) on an “AS IS” BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, -including, without limitation, any warranties or conditions of TITLE, -NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are -solely responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your exercise of -permissions under this License. - -#### 8. Limitation of Liability - -In no event and under no legal theory, whether in tort (including negligence), -contract, or otherwise, unless required by applicable law (such as deliberate -and grossly negligent acts) or agreed to in writing, shall any Contributor be -liable to You for damages, including any direct, indirect, special, incidental, -or consequential damages of any character arising as a result of this License or -out of the use or inability to use the Work (including but not limited to -damages for loss of goodwill, work stoppage, computer failure or malfunction, or -any and all other commercial damages or losses), even if such Contributor has -been advised of the possibility of such damages. - -#### 9. Accepting Warranty or Additional Liability - -While redistributing the Work or Derivative Works thereof, You may choose to -offer, and charge a fee for, acceptance of support, warranty, indemnity, or -other liability obligations and/or rights consistent with this License. However, -in accepting such obligations, You may act only on Your own behalf and on Your -sole responsibility, not on behalf of any other Contributor, and only if You -agree to indemnify, defend, and hold each Contributor harmless for any liability -incurred by, or claims asserted against, such Contributor by reason of your -accepting any such warranty or additional liability. - -_END OF TERMS AND CONDITIONS_ - -### APPENDIX: How to apply the Apache License to your work - -To apply the Apache License to your work, attach the following boilerplate -notice, with the fields enclosed by brackets `[]` replaced with your own -identifying information. (Don't include the brackets!) The text should be -enclosed in the appropriate comment syntax for the file format. We also -recommend that a file or class name and description of purpose be included on -the same “printed page” as the copyright notice for easier identification within -third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. From e63470271f928f29131b44aede29c0199f3bd903 Mon Sep 17 00:00:00 2001 From: Christian Autermann Date: Thu, 16 May 2019 15:52:33 +0200 Subject: [PATCH 2/5] updated to arctic-sea v6 --- pom.xml | 2 +- webapp/src/main/webapp/{ => WEB-INF/config}/configuration.json | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename webapp/src/main/webapp/{ => WEB-INF/config}/configuration.json (100%) diff --git a/pom.xml b/pom.xml index cefc77fd..156d348a 100644 --- a/pom.xml +++ b/pom.xml @@ -93,7 +93,7 @@ 5.1.3.RELEASE 1.7.25 2.3 - 5.3.0 + 6.0.0 diff --git a/webapp/src/main/webapp/configuration.json b/webapp/src/main/webapp/WEB-INF/config/configuration.json similarity index 100% rename from webapp/src/main/webapp/configuration.json rename to webapp/src/main/webapp/WEB-INF/config/configuration.json From 35eb2b4f7182103c53ea51be04571e68002cfd0a Mon Sep 17 00:00:00 2001 From: Christian Autermann Date: Thu, 16 May 2019 15:52:46 +0200 Subject: [PATCH 3/5] added Dockerfile --- .dockerignore | 9 ++ Dockerfile | 62 +++++++++++++ etc/docker-configuration.json | 162 ++++++++++++++++++++++++++++++++++ etc/docker-log4j2.xml | 38 ++++++++ 4 files changed, 271 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 etc/docker-configuration.json create mode 100644 etc/docker-log4j2.xml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 00000000..5b9d7f35 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,9 @@ +**/target/ +docs/ +Dockerfile +NOTICE +LICENSE +README.md +.gitignore +.travis.yml + diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..2c149957 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,62 @@ +FROM maven:3-jdk-8-alpine AS BUILD + +RUN apk add --no-cache git + +WORKDIR /usr/src/app + +COPY . /usr/src/app + +RUN mvn --batch-mode --errors --fail-fast \ + --define maven.javadoc.skip=true \ + --define skipTests=true install + +FROM jetty:jre8-alpine + +ARG JAVAPS_VERSION=1.3.0-SNAPSHOT +ENV JAVAPS_VERSION ${JAVAPS_VERSION} +ENV JAVAPS_ROOT ${JETTY_BASE}/webapps/ROOT +ENV JAVAPS_TMP ${JAVAPS_ROOT}/WEB-INF/tmp +ENV JAVAPS_CONFIG ${JAVAPS_ROOT}/WEB-INF/config +ENV JAVAPS_LIB ${JAVAPS_ROOT}/WEB-INF/lib + +COPY --from=BUILD /usr/src/app/webapp/target/javaPS-webapp-${JAVAPS_VERSION}/ /var/lib/jetty/webapps/ROOT +COPY etc/docker-log4j2.xml /var/lib/jetty/webapps/ROOT/WEB-INF/config/log4j2.xml +COPY etc/docker-configuration.json /var/lib/jetty/webapps/ROOT/WEB-INF/config/configuration.json + +USER root +RUN set -ex \ + && apk add --no-cache jq \ + && wget -q -P /usr/local/bin https://raw.githubusercontent.com/52North/arctic-sea/master/etc/faroe-entrypoint.sh \ + && chmod +x /usr/local/bin/faroe-entrypoint.sh \ + && ln -sf ${JAVAPS_CONFIG}/log4j2.xml ${JAVAPS_ROOT}/WEB-INF/classes/log4j2.xml \ + && mkdir -p ${JAVAPS_TMP}\ + && chown -R jetty:jetty ${JAVAPS_ROOT} +USER jetty + +VOLUME /var/lib/jetty/webapps/ROOT/WEB-INF/tmp +VOLUME /var/lib/jetty/webapps/ROOT/WEB-INF/config + +HEALTHCHECK --interval=5s --timeout=20s --retries=3 \ + CMD wget http://localhost:8080/ -q -O - > /dev/null 2>&1 + +ENV FAROE_CONFIGURATION ${JAVAPS_CONFIG}/configuration.json + +LABEL maintainer="Benjamin Proß " \ + org.opencontainers.image.title="52°North javaPS" \ + org.opencontainers.image.description="Next generation standardized web-based geo-processing" \ + org.opencontainers.image.licenses="Apache-2.0" \ + org.opencontainers.image.url="https://github.com/52North/javaPS" \ + org.opencontainers.image.vendor="52°North GmbH" \ + org.opencontainers.image.source="https://github.com/52north/javaPS.git" \ + org.opencontainers.image.documentation="https://github.com/52North/javaPS/blob/develop/README.md" \ + org.opencontainers.image.version="${JAVAPS_VERSION}" \ + org.opencontainers.image.authors="Benjamin Proß , Christian Autermann " + +ARG GIT_COMMIT +LABEL org.opencontainers.image.revision "${GIT_COMMIT}" + +ARG BUILD_DATE +LABEL org.opencontainers.image.created "${BUILD_DATE}" + +CMD [ "java", "-jar", "/usr/local/jetty/start.jar" ] +ENTRYPOINT [ "/usr/local/bin/faroe-entrypoint.sh", "/docker-entrypoint.sh" ] diff --git a/etc/docker-configuration.json b/etc/docker-configuration.json new file mode 100644 index 00000000..281a1a9b --- /dev/null +++ b/etc/docker-configuration.json @@ -0,0 +1,162 @@ +{ + "settings" : { + "misc.httpResponseCodeUseInKvpAndPoxBinding" : { + "type" : "boolean", + "value" : false + }, + "serviceProvider.name" : { + "type" : "string", + "value" : "52North" + }, + "serviceProvider.file" : { + "type" : "file", + "value" : null + }, + "serviceProvider.site" : { + "type" : "uri", + "value" : "http://52north.org" + }, + "serviceProvider.individualName" : { + "type" : "string", + "value" : "TBA" + }, + "serviceProvider.phone" : { + "type" : "string", + "value" : "+49(0)251/396 371-0" + }, + "serviceProvider.facsimile" : { + "type" : "string", + "value" : "+49(0)251/396 371-11" + }, + "serviceProvider.address" : { + "type" : "string", + "value" : "Martin-Luther-King-Weg 24" + }, + "serviceProvider.city" : { + "type" : "string", + "value" : "Münster" + }, + "serviceProvider.postalCode" : { + "type" : "string", + "value" : "48155" + }, + "serviceProvider.country" : { + "type" : "string", + "value" : "Germany" + }, + "serviceProvider.email" : { + "type" : "string", + "value" : "info@52north.org" + }, + "serviceProvider.state" : { + "type" : "string", + "value" : "North Rhine-Westphalia" + }, + "serviceProvider.positionName" : { + "type" : "string", + "value" : "TBA" + }, + "serviceProvider.hoursOfService" : { + "type" : "string", + "value" : "9 to 5" + }, + "serviceProvider.contactInstructions" : { + "type" : "string", + "value" : "Call or email, please!" + }, + "serviceProvider.onlineResource" : { + "type" : "string", + "value" : "team website|https://github.com/orgs/52North/teams/geoprocessing/members" + }, + "serviceProvider.role.value" : { + "type" : "string", + "value" : "resourceProvider" + }, + "serviceProvider.role.codespace" : { + "type" : "uri", + "value" : "http://www.isotc211.org/2005/resources/Codelist/gmxCodelists.xml#CI_RoleCode" + }, + "serviceIdentification.file" : { + "type" : "file", + "value" : null + }, + "serviceIdentification.abstract" : { + "type" : "multilingual", + "value" : { + "en" : "52North WPS 2.0 Service", + "de" : "52North WPS 2.0 Dienst" + } + }, + "serviceIdentification.title" : { + "type" : "multilingual", + "value" : { + "en" : "javaPS", + "de" : "javaPS" + } + }, + "serviceIdentification.keywords" : { + "type" : "string", + "value" : "OGC, WPS 2.0" + }, + "serviceIdentification.serviceType" : { + "type" : "string", + "value" : "OGC:TEST" + }, + "i18n.defaultLanguage" : { + "type" : "string", + "value" : "en" + }, + "serviceIdentification.serviceTypeCodeSpace" : { + "type" : "string", + "value" : null + }, + "serviceIdentification.fees" : { + "type" : "string", + "value" : "NONE" + }, + "serviceIdentification.accessConstraints" : { + "type" : "string", + "value" : "NONE" + }, + "misc.includeStackTraceInExceptionReport" : { + "type" : "boolean", + "value" : true + }, + "misc.characterEncoding" : { + "type" : "string", + "value" : "UTF-8" + }, + "i18n.showAllLanguageValues" : { + "type" : "boolean", + "value" : false + }, + "statistics.counting-outputstream" : { + "type" : "boolean", + "value" : false + }, + "service.serviceURL" : { + "type" : "uri", + "value" : "http://localhost:8080/service" + }, + "filewatcher.enabled" : { + "type" : "boolean", + "value" : true + }, + "misc.includeOriginalRequest" : { + "type" : "boolean", + "value" : false + }, + "misc.baseDirectory" : { + "type" : "file", + "value" : "/var/lib/jetty/webapps/ROOT/WEB-INF/tmp/" + }, + "misc.duration" : { + "type" : "string", + "value" : "PT2H" + }, + "misc.checkInterval" : { + "type" : "string", + "value" : "PT1H" + } + } +} \ No newline at end of file diff --git a/etc/docker-log4j2.xml b/etc/docker-log4j2.xml new file mode 100644 index 00000000..57e32bf1 --- /dev/null +++ b/etc/docker-log4j2.xml @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + From 3c69c83a5dec06e3e75ce8d9ac51b16bcb1530e6 Mon Sep 17 00:00:00 2001 From: Christian Autermann Date: Thu, 16 May 2019 16:06:56 +0200 Subject: [PATCH 4/5] fixed docker health check --- .dockerignore | 1 - Dockerfile | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 5b9d7f35..a7cdeac5 100644 --- a/.dockerignore +++ b/.dockerignore @@ -4,6 +4,5 @@ Dockerfile NOTICE LICENSE README.md -.gitignore .travis.yml diff --git a/Dockerfile b/Dockerfile index 2c149957..962355c3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ VOLUME /var/lib/jetty/webapps/ROOT/WEB-INF/tmp VOLUME /var/lib/jetty/webapps/ROOT/WEB-INF/config HEALTHCHECK --interval=5s --timeout=20s --retries=3 \ - CMD wget http://localhost:8080/ -q -O - > /dev/null 2>&1 + CMD wget 'http://localhost:8080/service?service=WPS&request=GetCapabilities' -q -O - > /dev/null 2>&1 ENV FAROE_CONFIGURATION ${JAVAPS_CONFIG}/configuration.json From 012c08f6283b639afba26e329a44eb9874018e22 Mon Sep 17 00:00:00 2001 From: Christian Autermann Date: Thu, 16 May 2019 16:23:10 +0200 Subject: [PATCH 5/5] created non-alpine version --- .dockerignore | 1 + Dockerfile | 6 +++-- alpine.Dockerfile | 62 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 2 deletions(-) create mode 100644 alpine.Dockerfile diff --git a/.dockerignore b/.dockerignore index a7cdeac5..98445261 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,6 +1,7 @@ **/target/ docs/ Dockerfile +Dockerfile-alpine NOTICE LICENSE README.md diff --git a/Dockerfile b/Dockerfile index 962355c3..d2199d18 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN mvn --batch-mode --errors --fail-fast \ --define maven.javadoc.skip=true \ --define skipTests=true install -FROM jetty:jre8-alpine +FROM jetty:jre8 ARG JAVAPS_VERSION=1.3.0-SNAPSHOT ENV JAVAPS_VERSION ${JAVAPS_VERSION} @@ -25,7 +25,9 @@ COPY etc/docker-configuration.json /var/lib/jetty/webapps/ROOT/WEB-INF/config/co USER root RUN set -ex \ - && apk add --no-cache jq \ + && apt-get update \ + && apt-get install -y --no-install-recommends jq \ + && rm -rf /var/lib/apt/lists/* \ && wget -q -P /usr/local/bin https://raw.githubusercontent.com/52North/arctic-sea/master/etc/faroe-entrypoint.sh \ && chmod +x /usr/local/bin/faroe-entrypoint.sh \ && ln -sf ${JAVAPS_CONFIG}/log4j2.xml ${JAVAPS_ROOT}/WEB-INF/classes/log4j2.xml \ diff --git a/alpine.Dockerfile b/alpine.Dockerfile new file mode 100644 index 00000000..962355c3 --- /dev/null +++ b/alpine.Dockerfile @@ -0,0 +1,62 @@ +FROM maven:3-jdk-8-alpine AS BUILD + +RUN apk add --no-cache git + +WORKDIR /usr/src/app + +COPY . /usr/src/app + +RUN mvn --batch-mode --errors --fail-fast \ + --define maven.javadoc.skip=true \ + --define skipTests=true install + +FROM jetty:jre8-alpine + +ARG JAVAPS_VERSION=1.3.0-SNAPSHOT +ENV JAVAPS_VERSION ${JAVAPS_VERSION} +ENV JAVAPS_ROOT ${JETTY_BASE}/webapps/ROOT +ENV JAVAPS_TMP ${JAVAPS_ROOT}/WEB-INF/tmp +ENV JAVAPS_CONFIG ${JAVAPS_ROOT}/WEB-INF/config +ENV JAVAPS_LIB ${JAVAPS_ROOT}/WEB-INF/lib + +COPY --from=BUILD /usr/src/app/webapp/target/javaPS-webapp-${JAVAPS_VERSION}/ /var/lib/jetty/webapps/ROOT +COPY etc/docker-log4j2.xml /var/lib/jetty/webapps/ROOT/WEB-INF/config/log4j2.xml +COPY etc/docker-configuration.json /var/lib/jetty/webapps/ROOT/WEB-INF/config/configuration.json + +USER root +RUN set -ex \ + && apk add --no-cache jq \ + && wget -q -P /usr/local/bin https://raw.githubusercontent.com/52North/arctic-sea/master/etc/faroe-entrypoint.sh \ + && chmod +x /usr/local/bin/faroe-entrypoint.sh \ + && ln -sf ${JAVAPS_CONFIG}/log4j2.xml ${JAVAPS_ROOT}/WEB-INF/classes/log4j2.xml \ + && mkdir -p ${JAVAPS_TMP}\ + && chown -R jetty:jetty ${JAVAPS_ROOT} +USER jetty + +VOLUME /var/lib/jetty/webapps/ROOT/WEB-INF/tmp +VOLUME /var/lib/jetty/webapps/ROOT/WEB-INF/config + +HEALTHCHECK --interval=5s --timeout=20s --retries=3 \ + CMD wget 'http://localhost:8080/service?service=WPS&request=GetCapabilities' -q -O - > /dev/null 2>&1 + +ENV FAROE_CONFIGURATION ${JAVAPS_CONFIG}/configuration.json + +LABEL maintainer="Benjamin Proß " \ + org.opencontainers.image.title="52°North javaPS" \ + org.opencontainers.image.description="Next generation standardized web-based geo-processing" \ + org.opencontainers.image.licenses="Apache-2.0" \ + org.opencontainers.image.url="https://github.com/52North/javaPS" \ + org.opencontainers.image.vendor="52°North GmbH" \ + org.opencontainers.image.source="https://github.com/52north/javaPS.git" \ + org.opencontainers.image.documentation="https://github.com/52North/javaPS/blob/develop/README.md" \ + org.opencontainers.image.version="${JAVAPS_VERSION}" \ + org.opencontainers.image.authors="Benjamin Proß , Christian Autermann " + +ARG GIT_COMMIT +LABEL org.opencontainers.image.revision "${GIT_COMMIT}" + +ARG BUILD_DATE +LABEL org.opencontainers.image.created "${BUILD_DATE}" + +CMD [ "java", "-jar", "/usr/local/jetty/start.jar" ] +ENTRYPOINT [ "/usr/local/bin/faroe-entrypoint.sh", "/docker-entrypoint.sh" ]