From aad9076b3f3aa6ff9323d9f2a9e2443f02efe858 Mon Sep 17 00:00:00 2001 From: Disassembler Date: Tue, 23 Jan 2018 21:01:47 +0100 Subject: [PATCH] Add Mifos X user + Reorder tomcat installation sequence --- mifosx.sh | 2 +- mifosx/Dockerfile | 13 +++++++++---- motech/Dockerfile | 2 +- motech/etc/init.d/motech | 0 4 files changed, 11 insertions(+), 6 deletions(-) mode change 100644 => 100755 motech/etc/init.d/motech diff --git a/mifosx.sh b/mifosx.sh index 3294e83..7b0ba4c 100755 --- a/mifosx.sh +++ b/mifosx.sh @@ -23,7 +23,7 @@ rc-update add mifosx boot service mifosx start # Update admin account -echo `date` '- Waiting for `mifostenant-default` database to be populated. This should take about a minute.' +echo `date` '- Waiting for database to be populated. This should take about a minute.' until docker logs mifosx 2>&1 | grep -q 'Migrating schema `mifostenant-default` to version 5000'; do sleep 1 done diff --git a/mifosx/Dockerfile b/mifosx/Dockerfile index ece6a29..cb9100b 100644 --- a/mifosx/Dockerfile +++ b/mifosx/Dockerfile @@ -15,10 +15,11 @@ RUN \ wget http://mirror.dkm.cz/apache/tomcat/tomcat-8/v8.0.48/bin/apache-tomcat-8.0.48.tar.gz -O /tmp/apache-tomcat-8.tgz \ && tar xf /tmp/apache-tomcat-8.tgz -C /srv \ && mv /srv/apache-tomcat-8.0.48 /srv/tomcat \ - && rm -f /tmp/apache-tomcat-8.tgz \ - && rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager \ # Make catalina.sh available globally - && ln -s /srv/tomcat/bin/catalina.sh /usr/bin/catalina.sh + && ln -s /srv/tomcat/bin/catalina.sh /usr/bin/catalina.sh \ + # Cleanup + && rm -rf /srv/tomcat/webapps/ROOT /srv/tomcat/webapps/docs /srv/tomcat/webapps/examples /srv/tomcat/webapps/host-manager /srv/tomcat/webapps/manager \ + && rm -f /tmp/apache-tomcat-8.tgz RUN \ # Install full-featured wget to work around sourceforge bugs @@ -36,11 +37,15 @@ RUN \ && sed -i 's/port="8080"/port="8012"/g' /srv/tomcat/conf/server.xml \ && echo -e '\r\nserver.port=8012' >> /srv/tomcat/webapps/fineract-provider/WEB-INF/classes/application.properties \ && sed -i 's/requires-channel="https" //g' /srv/tomcat/webapps/fineract-provider/WEB-INF/classes/META-INF/spring/securityContext.xml \ + # Create OS user + && addgroup -S -g 8012 mifosx \ + && adduser -S -u 8012 -h /srv/tomcat -s /bin/false -g mifosx -G mifosx mifosx \ + && chown -R mifosx:mifosx /srv/tomcat/conf /srv/tomcat/logs /srv/tomcat/temp /srv/tomcat/work \ # Cleanup && apk del wget \ && rm -rf /tmp/fineractplatform-17.07.01.RELEASE /tmp/mifosx.zip EXPOSE 8012 -#USER mifosx +USER mifosx CMD ["catalina.sh", "run"] diff --git a/motech/Dockerfile b/motech/Dockerfile index 54e5265..9843403 100644 --- a/motech/Dockerfile +++ b/motech/Dockerfile @@ -35,7 +35,7 @@ RUN \ # Create OS user && addgroup -S -g 8013 motech \ && adduser -S -u 8013 -h /srv/tomcat -s /bin/false -g motech -G motech motech \ - && chown -R motech:motech /srv/tomcat \ + && chown -R motech:motech /srv/tomcat/conf /srv/tomcat/logs /srv/tomcat/temp /srv/tomcat/webapps /srv/tomcat/work \ # Cleanup && rm -f /tmp/motech.war diff --git a/motech/etc/init.d/motech b/motech/etc/init.d/motech old mode 100644 new mode 100755