Skip to content

Commit

Permalink
Merge pull request #21 from tianon/minor-tweaks
Browse files Browse the repository at this point in the history
Adjust a few minor bits
  • Loading branch information
pierreozoux committed Mar 4, 2016
2 parents fb0f740 + a538fda commit 7aaf9aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
21 changes: 11 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,34 +11,35 @@ RUN apt-get update && apt-get install -y \
zip \
&& rm -rf /var/lib/apt/lists/*

RUN gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 0xb5dbd5925590a237

RUN docker-php-ext-configure gd --with-freetype-dir=/usr --with-png-dir=/usr --with-jpeg-dir=/usr \
&& docker-php-ext-install gd mbstring mysql pdo_mysql zip

RUN pecl install APCu geoip

ENV PIWIK_VERSION 2.16.0

VOLUME /var/www/html/

RUN curl -fsSL -o piwik.tar.gz \
"https://builds.piwik.org/piwik-${PIWIK_VERSION}.tar.gz" \
&& curl -fsSL -o piwik.tar.gz.asc \
"https://builds.piwik.org/piwik-${PIWIK_VERSION}.tar.gz.asc" \
&& gpg --verify piwik.tar.gz.asc \
&& export GNUPGHOME="$(mktemp -d)" \
&& gpg --keyserver ha.pool.sks-keyservers.net --recv-keys 814E346FA01A20DBB04B6807B5DBD5925590A237 \
&& gpg --batch --verify piwik.tar.gz.asc piwik.tar.gz \
&& rm -r "$GNUPGHOME" piwik.tar.gz.asc \
&& tar -xzf piwik.tar.gz -C /usr/src/ \
&& rm piwik.tar.gz piwik.tar.gz.asc \
&& rm piwik.tar.gz \
&& chfn -f 'Piwik Admin' www-data

COPY php.ini /usr/local/etc/php/php.ini

RUN cd /usr/src/piwik/misc \
&& curl http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz > GeoLiteCity.dat.gz \
&& gunzip GeoLiteCity.dat.gz \
&& mv GeoLiteCity.dat GeoIPCity.dat
RUN curl -fsSL -o /usr/src/piwik/misc/GeoIPCity.dat.gz http://geolite.maxmind.com/download/geoip/database/GeoLiteCity.dat.gz \
&& gunzip /usr/src/piwik/misc/GeoIPCity.dat.gz

COPY docker-entrypoint.sh /entrypoint.sh

# WORKDIR is /var/www/html (inhertied via "FROM php")
# "/entrypoint.sh" will populate it at container startup from /usr/src/piwik
VOLUME /var/www/html

ENTRYPOINT ["/entrypoint.sh"]
CMD ["php-fpm"]
4 changes: 2 additions & 2 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/bin/bash
set -e

if [ ! -e '/var/www/html/piwik.php' ]; then
if [ ! -e piwik.php ]; then
tar cf - --one-file-system -C /usr/src/piwik . | tar xf -
chown -R www-data /var/www/html
chown -R www-data .
fi

exec "$@"

0 comments on commit 7aaf9aa

Please sign in to comment.