move to base-php, move download out of Dockerfile
Some checks failed
the build failed

move to base-php, which is based on a self built caddy container.
move download out of Dockerfile, because this made it huge and unreadable.

fixes #1
This commit is contained in:
Jan Christian Grünhage 2018-01-28 00:25:00 +01:00
parent aa1922b0d0
commit 6b89f02232
Signed by: jcgruenhage
GPG key ID: 6594C449C633D10C
8 changed files with 23 additions and 66 deletions

View file

@ -1,4 +1,10 @@
pipeline:
download:
image: docker.io/fedora
commands:
- dnf install -y zip
- curl https://www.rainloop.net/repository/webmail/rainloop-community-latest.zip > rainloop.zip
- unzip rainloop.zip -d rainloop
docker:
image: plugins/docker
repo: docker.jcg.re/rainloop

View file

@ -1,46 +1,20 @@
FROM docker.jcg.re/base-alpine
FROM docker.jcg.re/base-php
ARG GPG_rainloop="3B79 7ECE 694F 3B7B 70F3 11A4 ED7C 49D9 87DA 4591"
RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
&& apk add --update \
curl \
gnupg \
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/linux/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
ADD rainloop /rainloop
RUN apk add --no-cache \
php7-curl \
php7-iconv \
php7-xml \
php7-dom \
php7-openssl \
php7-json \
php7-zlib \
php7-pdo_mysql \
php7-pdo_pgsql \
php7-pdo_sqlite \
php7-sqlite3 \
&& sed -i "s#/phpapp#/rainloop#" /etc/Caddyfile \
&& sed -i "s#/phpapp#/rainloop#" /etc/s6.d/php/run \
&& echo "internal /data" >> /etc/Caddyfile
ADD root /
EXPOSE 8888
VOLUME /rainloop/data

View file

@ -1,5 +0,0 @@
:8888 {
root /rainloop
internal /data
fastcgi / /tmp/php-fpm.sock php
}

View file

@ -1,11 +0,0 @@
[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 = /

View file

@ -1 +0,0 @@
#!/bin/sh

View file

@ -1,2 +0,0 @@
#!/bin/sh
su-exec ${UID}:${GID} caddy --conf /etc/Caddyfile

View file

@ -1 +0,0 @@
#!/bin/sh

View file

@ -1,3 +0,0 @@
#!/bin/sh
chown -R ${UID}:${GID} /rainloop /var/log/php7
su-exec ${UID}:${GID} php-fpm7