From 68d674197da3539f96fde41bb38cfe41876f04cc Mon Sep 17 00:00:00 2001 From: andryyy Date: Sat, 21 Jan 2017 11:47:51 +0100 Subject: [PATCH] Loop reconf script, add minimal httpd for web resources chrooted --- data/Dockerfiles/sogo/Dockerfile | 14 +++++++++++--- data/Dockerfiles/sogo/reconf-domains.sh | 9 ++++----- data/Dockerfiles/sogo/supervisord.conf | 6 ++++++ 3 files changed, 21 insertions(+), 8 deletions(-) diff --git a/data/Dockerfiles/sogo/Dockerfile b/data/Dockerfiles/sogo/Dockerfile index 2d043fdd..43960438 100644 --- a/data/Dockerfiles/sogo/Dockerfile +++ b/data/Dockerfiles/sogo/Dockerfile @@ -11,7 +11,14 @@ RUN dpkg-divert --local --rename --add /sbin/initctl \ && ln -sf /bin/true /usr/bin/ischroot RUN apt-get update \ - && apt-get install -y --no-install-recommends apt-transport-https ca-certificates wget syslog-ng syslog-ng-core supervisor mysql-client cron \ + && apt-get install -y --no-install-recommends apt-transport-https \ + ca-certificates \ + wget \ + syslog-ng \ + syslog-ng-core \ + supervisor \ + mysql-client \ + cron \ && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \ @@ -35,8 +42,9 @@ RUN echo '0 0 * * * sogo /usr/sbin/sogo-tool update-autoreply -p /etc/sogo/s COPY ./reconf-domains.sh / COPY supervisord.conf /etc/supervisor/supervisord.conf -EXPOSE 20000 -EXPOSE 9191 +#EXPOSE 20000 +#EXPOSE 9191 +#EXPOSE 9192 CMD exec /usr/bin/supervisord -c /etc/supervisor/supervisord.conf diff --git a/data/Dockerfiles/sogo/reconf-domains.sh b/data/Dockerfiles/sogo/reconf-domains.sh index a024aa4a..f4cd26aa 100755 --- a/data/Dockerfiles/sogo/reconf-domains.sh +++ b/data/Dockerfiles/sogo/reconf-domains.sh @@ -1,10 +1,7 @@ #!/bin/bash # Wait for MySQL to warm-up -while ! mysqladmin ping --host mysql --silent; do - sleep 1 -done - +while mysqladmin ping --host mysql --silent; do # Recreate view @@ -99,4 +96,6 @@ echo ' chown sogo:sogo -R /var/lib/sogo/ chmod 600 /var/lib/sogo/GNUstep/Defaults/sogod.plist -sleep infinite +sleep 99999 + +done; diff --git a/data/Dockerfiles/sogo/supervisord.conf b/data/Dockerfiles/sogo/supervisord.conf index b59ff11c..5f2d4d28 100644 --- a/data/Dockerfiles/sogo/supervisord.conf +++ b/data/Dockerfiles/sogo/supervisord.conf @@ -30,6 +30,12 @@ stdout_logfile_maxbytes=0 command=/usr/sbin/cron -f autorestart=true +[program:sogo-webres] +command=/usr/bin/python -u -m SimpleHTTPServer 9192 +directory=/usr/lib/GNUstep/SOGo/ +user=sogo +autorestart=true + [inet_http_server] port=9191