piwik: migrate underlying image to nginx-php

This commit is contained in:
Wonderfall
2017-05-01 09:00:38 +02:00
parent 8f7a3f8f3b
commit 71f4262193
9 changed files with 35 additions and 119 deletions

View File

@ -1,9 +1,12 @@
FROM alpine:3.5
FROM wonderfall/nginx-php
ARG VERSION=3.0.3
ARG GPG_matthieu="814E 346F A01A 20DB B04B 6807 B5DB D592 5590 A237"
ENV UID=991 GID=991
ENV UID=991 GID=991 \
UPLOAD_MAX_SIZE=10M \
MEMORY_LIMIT=256M \
OPCACHE_MEM_SIZE=128M
RUN BUILD_DEPS=" \
git \
@ -16,31 +19,10 @@ RUN BUILD_DEPS=" \
gnupg" \
&& apk -U upgrade && apk add \
${BUILD_DEPS} \
nginx \
s6 \
su-exec \
geoip \
tzdata \
php7-fpm \
php7-gd \
php7-curl \
php7-session \
php7-json \
php7-ctype \
php7-mbstring \
php7-iconv \
php7-zlib \
php7-dom \
php7-openssl \
php7-mysqli \
php7-mysqlnd \
php7-pdo \
php7-pdo_mysql \
php7-dev \
php7-pear \
&& sed -i "$ s|\-n||g" /usr/bin/pecl && pecl install geoip-1.1.1 \
&& echo 'extension=geoip.so' >> /etc/php7/conf.d/00_geoip.ini \
&& echo 'geoip.custom_directory=/piwik/misc' >> /etc/php7/php.ini \
&& pecl install geoip-1.1.1 \
&& echo 'extension=geoip.so' >> /php/conf.d/geoip.ini \
&& mkdir /piwik && cd /tmp \
&& PIWIK_TARBALL="piwik-${VERSION}.tar.gz" \
&& wget -q https://builds.piwik.org/${PIWIK_TARBALL} \
@ -54,16 +36,13 @@ RUN BUILD_DEPS=" \
&& if [ "${FINGERPRINT}" != "${GPG_matthieu}" ]; then echo "Warning! Wrong GPG fingerprint!" && exit 1; fi \
&& echo "All seems good, now unpacking ${PIWIK_TARBALL}..." \
&& tar xzf ${PIWIK_TARBALL} --strip 1 -C /piwik \
&& wget -q https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz -P /piwik/misc \
&& gzip -d /piwik/misc/GeoLiteCity.dat.gz \
&& mv /piwik/misc/GeoLiteCity.dat /piwik/misc/GeoIPCity.dat \
&& wget -q https://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz -P /usr/share/GeoIP/ \
&& gzip -d /usr/share/GeoIP/GeoLiteCity.dat.gz \
&& mv /usr/share/GeoIP/GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat \
&& apk del ${BUILD_DEPS} php7-dev php7-pear \
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
COPY nginx.conf /etc/nginx/nginx.conf
COPY php-fpm.conf /etc/php7/php-fpm.conf
COPY s6.d /etc/s6.d
COPY run.sh /usr/local/bin/run.sh
COPY rootfs /
RUN chmod +x /usr/local/bin/run.sh /etc/s6.d/*/* /etc/s6.d/.s6-svscan/*