diff --git a/docker/Dockerfile b/docker/Dockerfile index 16ff55b4231ad18d864e9abcef47b4aca3ee9eb8..22e203d66737b2f230c8b4115ae0ea9ebb005cab 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -17,13 +17,6 @@ ENV HOME /root RUN apt-get -y update \ && apt-get -y install apt-utils unzip -ENV WEBAPP_DIR=/webapps/vlkb-siav2 - -RUN mkdir -p ${WEBAPP_DIR} -ARG VLKB_VERSION -COPY vlkb-siav2-${VLKB_VERSION}.war ${WEBAPP_DIR}/ -RUN cd ${WEBAPP_DIR} && unzip vlkb-siav2-${VLKB_VERSION}.war - # Tomcat must load postgresql DB driver, vlkb-siav2 does not explicitely load it COPY deps/postgresql-*.jar ${CATALINA_BASE}/lib/ @@ -37,17 +30,30 @@ COPY deps/setenv.sh ${CATALINA_BASE}/bin/ WORKDIR ${CATALINA_BASE} RUN chmod -R a+rwX conf -# enable config at start-up -RUN chmod a+rw ${WEBAPP_DIR}/WEB-INF/web.xml \ - && chmod a+rw ${WEBAPP_DIR}/WEB-INF/classes/search.properties \ - && chmod a+rw ${WEBAPP_DIR}/WEB-INF/classes/formatresponsefilter.properties - # set default env DISCOVERY_CONTEXT_ROOT=datasets # configure during start-up COPY start-siav2.sh /root +# create empty to be able to volume-bind at start-up +ENV STARTUP_LOG=/tmp/start-siav2.log +RUN echo " " > ${STARTUP_LOG} + +# install webapp +ENV WEBAPP_DIR=/webapps/vlkb-siav2 + +RUN mkdir -p ${WEBAPP_DIR} +ARG VLKB_VERSION +COPY vlkb-siav2-${VLKB_VERSION}.war ${WEBAPP_DIR}/ +RUN cd ${WEBAPP_DIR} && unzip vlkb-siav2-${VLKB_VERSION}.war + +# enable config at start-up +RUN chmod a+rw ${WEBAPP_DIR}/WEB-INF/web.xml \ + && chmod a+rw ${WEBAPP_DIR}/WEB-INF/classes/search.properties \ + && chmod a+rw ${WEBAPP_DIR}/WEB-INF/classes/formatresponsefilter.properties + + # run RUN chmod +rx /root && chmod +rx /root/start-siav2.sh diff --git a/docker/start-siav2.sh b/docker/start-siav2.sh index f32b149f51282d9c7c46f1c9beffbe6263bebbc7..4bab12eb36e488809add567c062ca071cb82546d 100755 --- a/docker/start-siav2.sh +++ b/docker/start-siav2.sh @@ -1,10 +1,9 @@ #!/bin/bash -set +e +set -eux { date -whoami env # configure CONTEXT_ROOT @@ -38,7 +37,7 @@ sed -i "s/.*DbObstap\.level.*=.*/DbObstap.level = $DBG_LEVEL/g" $CATALINA_BASE/c ################################################################### date -} 1> /tmp/start-siav2.log 2>&1 +} 1> $STARTUP_LOG $CATALINA_HOME/bin/catalina.sh run