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 ...@@ -17,13 +17,6 @@ ENV HOME /root
RUN apt-get -y update \ RUN apt-get -y update \
&& apt-get -y install apt-utils unzip && 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 # Tomcat must load postgresql DB driver, vlkb-siav2 does not explicitely load it
COPY deps/postgresql-*.jar ${CATALINA_BASE}/lib/ COPY deps/postgresql-*.jar ${CATALINA_BASE}/lib/
...@@ -37,17 +30,30 @@ COPY deps/setenv.sh ${CATALINA_BASE}/bin/ ...@@ -37,17 +30,30 @@ COPY deps/setenv.sh ${CATALINA_BASE}/bin/
WORKDIR ${CATALINA_BASE} WORKDIR ${CATALINA_BASE}
RUN chmod -R a+rwX conf 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 # set default
env DISCOVERY_CONTEXT_ROOT=datasets env DISCOVERY_CONTEXT_ROOT=datasets
# configure during start-up # configure during start-up
COPY start-siav2.sh /root 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
RUN chmod +rx /root && chmod +rx /root/start-siav2.sh RUN chmod +rx /root && chmod +rx /root/start-siav2.sh
......
#!/bin/bash #!/bin/bash
set +e set -eux
{ {
date date
whoami
env env
# configure CONTEXT_ROOT # configure CONTEXT_ROOT
...@@ -38,7 +37,7 @@ sed -i "s/.*DbObstap\.level.*=.*/DbObstap.level = $DBG_LEVEL/g" $CATALINA_BASE/c ...@@ -38,7 +37,7 @@ sed -i "s/.*DbObstap\.level.*=.*/DbObstap.level = $DBG_LEVEL/g" $CATALINA_BASE/c
################################################################### ###################################################################
date date
} 1> /tmp/start-siav2.log 2>&1 } 1> $STARTUP_LOG
$CATALINA_HOME/bin/catalina.sh run $CATALINA_HOME/bin/catalina.sh run
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment