mirror of
https://github.com/hoellen/dockerfiles.git
synced 2025-04-19 20:09:16 +00:00
piwik: update
This commit is contained in:
parent
dc677cbf88
commit
b2a444983c
@ -1,14 +1,13 @@
|
||||
FROM alpine:edge
|
||||
FROM alpine:3.4
|
||||
MAINTAINER Wonderfall <wonderfall@mondedie.fr>
|
||||
|
||||
ARG VERSION=2.16.1
|
||||
ARG VERSION=2.16.2
|
||||
|
||||
ARG GPG_matthieu="814E 346F A01A 20DB B04B 6807 B5DB D592 5590 A237"
|
||||
|
||||
ENV GID=991 UID=991
|
||||
ENV UID=991 GID=991
|
||||
|
||||
RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/repositories \
|
||||
&& echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
|
||||
RUN echo "@commuedge https://nl.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories \
|
||||
&& BUILD_DEPS=" \
|
||||
git \
|
||||
tar \
|
||||
@ -21,25 +20,24 @@ RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/r
|
||||
&& apk -U add \
|
||||
${BUILD_DEPS} \
|
||||
nginx \
|
||||
supervisor \
|
||||
libwebp \
|
||||
s6 \
|
||||
su-exec \
|
||||
geoip \
|
||||
tini@commuedge \
|
||||
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 \
|
||||
php7-pdo_mysql@testing \
|
||||
php7-dev@testing \
|
||||
php7-pear@testing \
|
||||
php7-fpm@commuedge \
|
||||
php7-gd@commuedge \
|
||||
php7-curl@commuedge \
|
||||
php7-session@commuedge \
|
||||
php7-json@commuedge \
|
||||
php7-ctype@commuedge \
|
||||
php7-mbstring@commuedge \
|
||||
php7-iconv@commuedge \
|
||||
php7-zlib@commuedge \
|
||||
php7-dom@commuedge \
|
||||
php7-openssl@commuedge \
|
||||
php7-mysqli@commuedge \
|
||||
php7-pdo_mysql@commuedge \
|
||||
php7-dev@commuedge \
|
||||
php7-pear@commuedge \
|
||||
&& cd /tmp && git clone https://github.com/Zakay/geoip && cd geoip \
|
||||
&& phpize7 && ./configure --with-php-config=/usr/bin/php-config7 && make && make install \
|
||||
&& echo 'extension=geoip.so' >> /etc/php7/conf.d/00_geoip.ini \
|
||||
@ -68,15 +66,16 @@ RUN echo "@testing https://nl.alpinelinux.org/alpine/edge/testing" >> /etc/apk/r
|
||||
|
||||
COPY nginx.conf /etc/nginx/nginx.conf
|
||||
COPY php-fpm.conf /etc/php7/php-fpm.conf
|
||||
COPY supervisord.conf /usr/local/etc/supervisord.conf
|
||||
COPY s6.d /etc/s6.d
|
||||
COPY run.sh /usr/local/bin/run.sh
|
||||
|
||||
RUN chmod +x /usr/local/bin/run.sh
|
||||
RUN chmod +x /usr/local/bin/run.sh /etc/s6.d/*/*
|
||||
|
||||
VOLUME /config
|
||||
EXPOSE 80
|
||||
|
||||
EXPOSE 8888
|
||||
|
||||
LABEL description "Open web analytics platform" \
|
||||
piwik "Piwik v${VERSION}"
|
||||
|
||||
CMD ["/sbin/tini","--","run.sh"]
|
||||
CMD ["run.sh"]
|
||||
|
@ -40,7 +40,7 @@ proxy_host_headers[] = HTTP_X_FORWARDED_HOST
|
||||
```
|
||||
|
||||
#### Reverse proxy
|
||||
Use port **80**.
|
||||
Use port **8888**.
|
||||
https://github.com/Wonderfall/dockerfiles/tree/master/reverse
|
||||
https://github.com/hardware/mailserver/wiki/Reverse-proxy-configuration
|
||||
|
||||
|
@ -1,6 +1,5 @@
|
||||
user piwik;
|
||||
worker_processes auto;
|
||||
pid /var/run/nginx.pid;
|
||||
pid /tmp/nginx.pid;
|
||||
daemon off;
|
||||
|
||||
events {
|
||||
@ -15,7 +14,11 @@ http {
|
||||
access_log off;
|
||||
error_log /var/log/nginx/error.log error;
|
||||
|
||||
fastcgi_temp_path /tmp 1 2;
|
||||
fastcgi_temp_path /tmp/fastcgi 1 2;
|
||||
client_body_temp_path /tmp/client_body 1 2;
|
||||
proxy_temp_path /tmp/proxy 1 2;
|
||||
uwsgi_temp_path /tmp/uwsgi 1 2;
|
||||
scgi_temp_path /tmp/scgi 1 2;
|
||||
|
||||
sendfile on;
|
||||
keepalive_timeout 15;
|
||||
@ -49,26 +52,26 @@ http {
|
||||
image/svg+xml;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
root /piwik;
|
||||
index index.php index.html;
|
||||
listen 8888;
|
||||
root /piwik;
|
||||
index index.php index.html;
|
||||
|
||||
location ~* \.(?:bat|git|ini|sh|svn[^.]*|txt|tpl|xml)$ {
|
||||
return 404;
|
||||
}
|
||||
location ~* \.(?:bat|git|ini|sh|svn[^.]*|txt|tpl|xml)$ {
|
||||
return 404;
|
||||
}
|
||||
|
||||
location ~* \.(jpg|jpeg|gif|css|png|js|map|woff|woff2|ttf|svg|eot)$ {
|
||||
expires 30d;
|
||||
access_log off;
|
||||
location ~* \.(jpg|jpeg|gif|css|png|js|map|woff|woff2|ttf|svg|eot)$ {
|
||||
expires 30d;
|
||||
access_log off;
|
||||
}
|
||||
|
||||
location = /favicon.ico {
|
||||
try_files /favicon.ico =204;
|
||||
}
|
||||
location = /favicon.ico {
|
||||
try_files /favicon.ico =204;
|
||||
}
|
||||
|
||||
location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
|
||||
return 404;
|
||||
}
|
||||
location ~* ^/(?:README|LICENSE[^.]*|LEGALNOTICE)(?:\.txt)*$ {
|
||||
return 404;
|
||||
}
|
||||
|
||||
location ~ ^/(vendor|config|tmp|libs|misc) {
|
||||
deny all;
|
||||
@ -83,15 +86,15 @@ http {
|
||||
deny all;
|
||||
}
|
||||
|
||||
location / {
|
||||
try_files $uri /index.php;
|
||||
}
|
||||
location / {
|
||||
try_files $uri /index.php;
|
||||
}
|
||||
|
||||
location ~ \.php$ {
|
||||
fastcgi_index index.php;
|
||||
fastcgi_pass unix:/var/run/php-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_pass unix:/tmp/php-fpm.sock;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
include /etc/nginx/fastcgi_params;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2,11 +2,7 @@
|
||||
daemonize = no
|
||||
|
||||
[www]
|
||||
user = piwik
|
||||
group = piwik
|
||||
listen = /var/run/php-fpm.sock
|
||||
listen.owner = piwik
|
||||
listen.group = piwik
|
||||
listen = /tmp/php-fpm.sock
|
||||
pm = dynamic
|
||||
pm.max_children = 5
|
||||
pm.start_servers = 2
|
||||
|
11
piwik/run.sh
11
piwik/run.sh
@ -1,12 +1,9 @@
|
||||
#!/bin/sh
|
||||
addgroup -g ${GID} piwik && adduser -h /piwik -s /bin/sh -D -G piwik -u ${UID} piwik
|
||||
|
||||
if [ -f /piwik/config/config.ini.php ] && [ ! -f /config/config.ini.php ]; then
|
||||
if [ ! -f /config/config.ini.php ]; then
|
||||
cp /piwik/config/config.ini.php /config/config.ini.php
|
||||
elif [ -f /config/config.ini.php ]; then
|
||||
mv /piwik/config/config.ini.php /config/config.ini.php.bkp
|
||||
cp /config/config.ini.php /piwik/config/config.ini.php
|
||||
fi
|
||||
|
||||
chown -R piwik:piwik /piwik /config /var/run/php-fpm.sock /var/lib/nginx /tmp
|
||||
exec supervisord -c /usr/local/etc/supervisord.conf
|
||||
ln -s /config/config.ini.php /piwik/config/config.ini.php
|
||||
chown -R $UID:$GID /piwik /config /var/log /etc/nginx /etc/php7 /var/lib/nginx /tmp /etc/s6.d
|
||||
exec su-exec $UID:$GID /bin/s6-svscan /etc/s6.d
|
||||
|
2
piwik/s6.d/nginx/run
Normal file
2
piwik/s6.d/nginx/run
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec nginx
|
2
piwik/s6.d/php/run
Normal file
2
piwik/s6.d/php/run
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/sh
|
||||
exec php-fpm7
|
Loading…
x
Reference in New Issue
Block a user