This repository has been archived on 2021-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
docker-piwik/Dockerfile

59 lines
2.0 KiB
Docker
Raw Normal View History

2018-01-17 21:54:30 +01:00
FROM registry.dryusdan.fr/dryusdan/php:7.1
2017-11-03 20:37:24 +01:00
2018-01-17 19:58:15 +01:00
2018-01-15 15:28:25 +01:00
ARG VERSION=3.3.0
2017-11-03 20:37:24 +01:00
ARG GPG_matthieu="814E 346F A01A 20DB B04B 6807 B5DB D592 5590 A237"
ENV UID=991 GID=991 \
UPLOAD_MAX_SIZE=10M \
2018-01-17 20:04:01 +01:00
MEMORY_LIMIT=512M \
OPCACHE_MEM_SIZE=256M
2017-11-03 20:37:24 +01:00
RUN BUILD_DEPS=" \
git \
tar \
build-base \
autoconf \
geoip-dev \
libressl \
ca-certificates \
gnupg" \
&& apk -U upgrade && apk add \
${BUILD_DEPS} \
geoip \
tzdata \
2018-01-17 19:33:28 +01:00
python2 \
2017-11-03 20:37:24 +01:00
&& 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} \
&& 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 /usr/share/GeoIP/ \
&& gzip -d /usr/share/GeoIP/GeoLiteCity.dat.gz \
&& mv /usr/share/GeoIP/GeoLiteCity.dat /usr/share/GeoIP/GeoIPCity.dat \
2018-01-17 19:33:28 +01:00
&& git clone https://github.com/matomo-org/matomo-log-analytics.git /tmp/mamoto-log-analytics \
&& mv /tmp/mamoto-log-analytics/import_logs.py /piwik/ \
2018-01-17 19:35:59 +01:00
&& apk del ${BUILD_DEPS} php7-dev php7-pear \
2017-11-03 20:37:24 +01:00
&& rm -rf /tmp/* /var/cache/apk/* /tmp/* /root/.gnupg /root/.cache/
COPY rootfs /
RUN chmod +x /usr/local/bin/startup /etc/s6.d/*/* /etc/s6.d/.s6-svscan/*
2018-01-17 21:35:04 +01:00
VOLUME ["/config", "/logs"]
2017-11-03 20:37:24 +01:00
2018-01-17 21:20:00 +01:00
EXPOSE 8080
2017-11-03 20:37:24 +01:00
ENTRYPOINT ["/usr/local/bin/startup"]
2018-01-17 20:45:45 +01:00
CMD ["/bin/s6-svscan", "/etc/s6.d"]