Skip to content
Snippets Groups Projects
Dockerfile 987 B
Newer Older
FROM indiepaas/nginx-php
Pierre Ozoux's avatar
Pierre Ozoux committed

RUN apt-get update && apt-get install -y \
      php5-gd \
      php5-geoip \
      php5-cli \
Pierre Ozoux's avatar
Pierre Ozoux committed
      zip \
Pierre Ozoux's avatar
Pierre Ozoux committed
      php-apc && \
    rm -rf /var/lib/apt/lists/* && \
Pierre Ozoux's avatar
Pierre Ozoux committed
    curl -O "http://builds.piwik.org/piwik.zip" && \
    unzip piwik.zip && \
Pierre Ozoux's avatar
Pierre Ozoux committed
    mv /piwik/config /piwik-config && \
Your Name's avatar
Your Name committed
    sed -i 's/;always_populate_raw_post_data = -1/always_populate_raw_post_data=-1/g' /etc/php5/fpm/php.ini && \
    cd /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 && \
Pierre Ozoux's avatar
Pierre Ozoux committed
    sed -i 's/# exec CMD/# exec CMD\n\/opt\/startup-piwik.sh/g' /opt/entrypoint.sh

# install nginx piwik config
ADD nginx-piwik.conf /etc/nginx/conf.d/nginx-piwik.conf

# add startup.sh
ADD startup-piwik.sh /opt/startup-piwik.sh
RUN chmod a+x /opt/startup-piwik.sh

# Expose environment variables
ENV DB_NAME piwik
ENV DB_USER admin

VOLUME "/piwik/config/"