Commit aff777fc authored by Robert Butora's avatar Robert Butora
Browse files

docker: consolidates docker build/configure and makes security conf the same as in vlkb-soda

parent e2a6b699
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -8,7 +8,10 @@ db_password=
# VLKB-legacy: surveys metadata in csv file
surveys_metadata_abs_pathname=

# these URL's are used in response.xml so client can access those services
# these URL's (up to '?') are used in response.xml so client can access those services
cutout_url=
merge_url=

# set reponse format
# response_format=application/x-votable+xml
+41 −0
Original line number Diff line number Diff line
@@ -12,27 +12,24 @@ RUN apt -y update \
                   rabbitmq-server openjdk-17-jre openjdk-17-jdk tomcat9 tomcat9-admin \
                   postgresql-client

ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64
ENV CATALINA_BASE=/var/lib/tomcat9
ENV CATALINA_HOME=/usr/share/tomcat9
ENV CATALINA_TMPDIR=/tmp
ENV WEBAPP_DIR=/webapps/vlkb-search

RUN mkdir -p /webapps/vlkb-search
RUN mkdir -p ${WEBAPP_DIR}
ARG VLKB_VERSION
COPY vlkb-search-${VLKB_VERSION}.war /webapps/vlkb-search/
RUN cd /webapps/vlkb-search && jar -xf vlkb-search-${VLKB_VERSION}.war \
COPY vlkb-search-${VLKB_VERSION}.war ${WEBAPP_DIR}/
RUN cd ${WEBAPP_DIR} && jar -xf vlkb-search-${VLKB_VERSION}.war \
 && mkdir /srv/surveys
COPY postgresql-*.jar  /var/lib/tomcat9/lib

# Lines with postgresql_*.jar: provide DB-driver so Tomcat loads it
# vlkb-search does not explicitely load DB-driver
# Tomcat must load postgresql DB driver, vlkb-search does not explicitely load it
COPY deps/postgresql-*.jar  /var/lib/tomcat9/lib

# configure

# configure instance

COPY config-vlkb/auth.properties config-vlkb/neatoken.properties config-vlkb/iamtoken.properties config-vlkb/formatresponsefilter.properties /webapps/vlkb-search/WEB-INF/classes/

#COPY ssl/keystore.jks /root/
COPY ssl/server.xml ssl/server-connector-8080.xml ssl/server-connector-8443.xml /etc/tomcat9/

# configure during docker run-time

COPY deps/server.xml deps/server-connector.xml /etc/tomcat9/
COPY entrypoint.sh /root

RUN echo "alias log-catalina='ls -t /var/log/tomcat9/catalina*.log | head -n 1 | xargs tail -200 '" >> /root/.bashrc
+1 −1
Original line number Diff line number Diff line
@@ -32,7 +32,7 @@ ast-9.2.9.tar.gz:

.PHONY: build
build:
	docker build --build-arg VLKB_VERSION=$(VERSION) -t siav2 -f Dockerfile.vlkb .
	docker build --build-arg VLKB_VERSION=$(VERSION) -t siav2 -f Dockerfile .

# the docker-login below needed a ca-cert(?) which in the middle of the certificate-chain,
# but was not automatically downloaded and also local cert/ket pair(?) ->
+0 −15
Original line number Diff line number Diff line
<Context docBase="/webapps/vlkb-cutout">

        <Resources allowLinking="true">
                <PostResources readOnly="false"
                        className="org.apache.catalina.webresources.DirResourceSet"
                        base="/srv/cutouts"
                        webAppMount="/cutouts"/>
                <PostResources readOnly="true"
                        className="org.apache.catalina.webresources.DirResourceSet"
                        base="/srv/surveys"
                        webAppMount="/surveys"/>
        </Resources>

</Context>
+0 −48
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You 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.
-->
<tomcat-users xmlns="http://tomcat.apache.org/xml"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://tomcat.apache.org/xml tomcat-users.xsd"
              version="1.0">
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary. It is
  strongly recommended that you do NOT use one of the users in the commented out
  section below since they are intended for use with the examples web
  application.
-->
<!--
  NOTE:  The sample user and role entries below are intended for use with the
  examples web application. They are wrapped in a comment and thus are ignored
  when reading this file. If you wish to configure these users for use with the
  examples web application, do not forget to remove the <!.. ..> that surrounds
  them. You will also need to set the passwords to something appropriate.
-->
<!--
  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="<must-be-changed>" roles="tomcat"/>
  <user username="both" password="<must-be-changed>" roles="tomcat,role1"/>
  <user username="role1" password="<must-be-changed>" roles="role1"/>
-->

  <role rolename="manager-script"/>
  <user username="admin" password="IA2lbt09" roles="manager-script"/>
</tomcat-users>
Loading