commit 4e11caad894a8b3761dd72877167a3405056c662 Author: Jan Christian Grünhage Date: Wed Jan 18 20:03:27 2017 +0100 Initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100755 index 0000000..0b4da85 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,51 @@ +FROM alpine:edge +MAINTAINER Jan Christian Grünhage + +ARG GPG_rainloop="3B79 7ECE 694F 3B7B 70F3 11A4 ED7C 49D9 87DA 4591" + +ENV GID=192 UID=192 + +RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \ + && apk add --update \ + curl \ + gnupg \ + s6 \ + su-exec \ + php7-fpm@commuedge \ + php7-curl@commuedge \ + php7-iconv@commuedge \ + php7-xml@commuedge \ + php7-dom@commuedge \ + php7-openssl@commuedge \ + php7-json@commuedge \ + php7-zlib@commuedge \ + php7-pdo_mysql@commuedge \ + php7-pdo_pgsql@commuedge \ + php7-pdo_sqlite@commuedge \ + php7-sqlite3@commuedge \ + && cd /tmp \ + && curl "https://caddyserver.com/download/build?os=linux&arch=amd64" \ + | tar -C /usr/local/bin -xz caddy \ + && curl http://repository.rainloop.net/v2/webmail/rainloop-community-latest.zip > rainloop-community-latest.zip \ + && curl http://repository.rainloop.net/v2/webmail/rainloop-community-latest.zip.asc > rainloop-community-latest.zip.asc \ + && curl http://repository.rainloop.net/RainLoop.asc > RainLoop.asc \ + && echo "Verifying authenticity of rainloop-community-latest.zip using GPG..." \ + && gpg --import RainLoop.asc \ + && FINGERPRINT="$(LANG=C gpg --verify rainloop-community-latest.zip.asc rainloop-community-latest.zip 2>&1 \ + | sed -n "s#Primary key fingerprint: \(.*\)#\1#p")" \ + && if [ -z "${FINGERPRINT}" ]; then echo "Warning! Invalid GPG signature!" && exit 1; fi \ + && if [ "${FINGERPRINT}" != "${GPG_rainloop}" ]; then echo "Warning! Wrong GPG fingerprint!" && exit 1; fi \ + && echo "All seems good, now unzipping rainloop-community-latest.zip..." \ + && mkdir /rainloop \ + && unzip -q /tmp/rainloop-community-latest.zip -d /rainloop \ + && find /rainloop -type d -exec chmod 755 {} \; \ + && find /rainloop -type f -exec chmod 644 {} \; \ + && chown -R ${GID}:${UID} /rainloop \ + && rm -rf /tmp/* /var/cache/apk /root/.gnupg + +COPY root / + +EXPOSE 8888 +VOLUME /rainloop/data +CMD ["/usr/local/bin/run.sh"] + diff --git a/root/etc/Caddyfile b/root/etc/Caddyfile new file mode 100755 index 0000000..35a1ef6 --- /dev/null +++ b/root/etc/Caddyfile @@ -0,0 +1,4 @@ +:8888 { + root /rainloop + fastcgi / /tmp/php-fpm.sock php +} diff --git a/root/etc/php7/php-fpm.conf b/root/etc/php7/php-fpm.conf new file mode 100755 index 0000000..f636044 --- /dev/null +++ b/root/etc/php7/php-fpm.conf @@ -0,0 +1,11 @@ +[global] +daemonize = no + +[www] +listen = /tmp/php-fpm.sock +pm = dynamic +pm.max_children = 5 +pm.start_servers = 2 +pm.min_spare_servers = 1 +pm.max_spare_servers = 3 +chdir = / diff --git a/root/etc/s6.d/caddy/run b/root/etc/s6.d/caddy/run new file mode 100755 index 0000000..22c7f1e --- /dev/null +++ b/root/etc/s6.d/caddy/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec caddy --conf /etc/Caddyfile diff --git a/root/etc/s6.d/php/run b/root/etc/s6.d/php/run new file mode 100755 index 0000000..e238021 --- /dev/null +++ b/root/etc/s6.d/php/run @@ -0,0 +1,2 @@ +#!/bin/sh +exec php-fpm7 diff --git a/root/usr/local/bin/run.sh b/root/usr/local/bin/run.sh new file mode 100755 index 0000000..499c7e1 --- /dev/null +++ b/root/usr/local/bin/run.sh @@ -0,0 +1,3 @@ +#!/bin/sh +chown -R $UID:$GID /rainloop /etc/Caddyfile /etc/php7 /var/log /tmp /etc/s6.d +exec su-exec $UID:$GID /bin/s6-svscan /etc/s6.d