dockerfiles/piwik/Dockerfile

80 lines
2.5 KiB
Docker
Raw Normal View History

FROM alpine:edge
2016-04-11 15:59:32 +02:00
2017-03-01 15:21:01 +01:00
ARG VERSION=3.0.2
ARG GPG_matthieu="814E 346F A01A 20DB B04B 6807 B5DB D592 5590 A237"
2016-09-17 15:53:34 +02:00
ENV UID=991 GID=991
2016-04-11 15:59:32 +02:00
2017-03-03 14:01:49 +01:00
RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
&& BUILD_DEPS=" \
git \
tar \
build-base \
autoconf \
geoip-dev \
2017-01-16 22:13:29 +01:00
libressl \
2016-05-08 22:19:31 +02:00
ca-certificates \
gnupg" \
2017-03-01 15:21:01 +01:00
&& apk -U upgrade && apk add \
2016-05-08 22:18:38 +02:00
${BUILD_DEPS} \
2016-04-11 15:59:32 +02:00
nginx \
2016-09-17 15:53:34 +02:00
s6 \
su-exec \
2016-05-01 16:29:24 +02:00
geoip \
2017-01-18 15:13:25 +01:00
tzdata \
2017-03-26 01:51:44 +01:00
php7-fpm@testing \
php7-gd@testing \
php7-curl@testing \
php7-session@testing \
php7-json@testing \
php7-ctype@testing \
php7-mbstring@testing \
php7-iconv@testing \
php7-zlib@testing \
php7-dom@testing \
php7-openssl@testing \
php7-mysqli@testing \
2017-03-26 04:07:16 +02:00
php7-mysqlnd@testing \
2017-03-26 04:31:44 +02:00
php7-pdo@testing \
2017-03-26 01:51:44 +01:00
php7-pdo_mysql@testing \
php7-dev@testing \
php7-pear@testing \
2017-03-01 15:21:01 +01:00
&& sed -i "$ s|\-n||g" /usr/bin/pecl && pecl install geoip-1.1.1 \
2017-03-26 01:51:44 +01:00
&& echo 'extension=geoip.so' >> /etc/php7/conf.d/00_geoip.ini \
&& echo 'geoip.custom_directory=/piwik/misc' >> /etc/php7/php.ini \
&& mkdir /piwik && cd /tmp \
&& PIWIK_TARBALL="piwik-${VERSION}.tar.gz" \
&& wget -q https://builds.piwik.org/${PIWIK_TARBALL} \
&& wget -q https://builds.piwik.org/${PIWIK_TARBALL}.asc \
&& wget -q https://builds.piwik.org/signature.asc \
&& echo "Verifying authenticity of ${PIWIK_TARBALL}..." \
&& gpg --import signature.asc \
&& FINGERPRINT="$(LANG=C gpg --verify ${PIWIK_TARBALL}.asc ${PIWIK_TARBALL} 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_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 \
2016-04-11 15:59:32 +02:00
&& gzip -d /piwik/misc/GeoLiteCity.dat.gz \
2016-05-01 17:10:03 +02:00
&& mv /piwik/misc/GeoLiteCity.dat /piwik/misc/GeoIPCity.dat \
2017-03-26 01:51:44 +01:00
&& apk del ${BUILD_DEPS} php7-dev php7-pear \
2016-05-30 19:43:23 +02:00
&& rm -rf /var/cache/apk/* /tmp/* /root/.gnupg
2016-04-11 15:59:32 +02:00
COPY nginx.conf /etc/nginx/nginx.conf
2017-03-26 01:51:44 +01:00
COPY php-fpm.conf /etc/php7/php-fpm.conf
2016-09-17 15:53:34 +02:00
COPY s6.d /etc/s6.d
2016-04-11 15:59:32 +02:00
COPY run.sh /usr/local/bin/run.sh
2016-09-24 11:48:17 +02:00
RUN chmod +x /usr/local/bin/run.sh /etc/s6.d/*/* /etc/s6.d/.s6-svscan/*
2016-04-11 15:59:32 +02:00
VOLUME /config
2016-09-17 15:53:34 +02:00
EXPOSE 8888
2016-04-11 15:59:32 +02:00
LABEL description "Open web analytics platform" \
2017-01-19 02:31:59 +01:00
piwik "Piwik v${VERSION}" \
maintainer="Wonderfall <wonderfall@targaryen.house>"
2016-09-17 15:53:34 +02:00
CMD ["run.sh"]