Skip to content
Snippets Groups Projects
Commit 606bec20 authored by Robert Butora's avatar Robert Butora
Browse files

docker: places webapp last in docker-build and set -eux for start-siav2.sh

parent a1f4e78b
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
#!/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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment