docker-piwik
Analytics and tracking with piwik in a Docker container
based on work by MarvAmBass
About
This Container Image gives you a pretty secure piwik.
It's based on the marvambass/nginx-ssl-php Image.
Quickstart
Database
MariaDB
docker run -d --name pwdb -e MYSQL_ROOT_PASSWORD=brutallysafe mariadb
Copy
MySQL
docker run -d --name piwikdb -e MYSQL_ROOT_PASSWORD=brutallysafe mysql
Copy
Piwik
docker run -d --name piwikapp -p 80:80 -p 443:443 --link pwdb:mysql mkodockx/docker-piwik
Copy
Environment Variables
Required for Headless Installation
Piwik Database Settings
PIWIK_TRUSTED_HOST_ACTIVE
default: 0 (means can be connected from any host)
PIWIK_TRUSTED_HOST
no default - needs to be set if PIWIK_TRUSTED_HOST_ACTIVE is used
PIWIK_MYSQL_USER
no default - if null it will start piwik in initial mode
PIWIK_MYSQL_PASSWORD
no default - if null it will start piwik in initial mode
PIWIK_MYSQL_HOST
default: mysql
PIWIK_MYSQL_PORT
default: 3306 - if you use a different mysql port change it
PIWIK_MYSQL_DBNAME
default: piwik - don't use the symbol - in there!
PIWIK_MYSQL_PREFIX
default: piwik_
Piwik Admin Settings
PIWIK_ADMIN
default: admin - the name of the admin user
PIWIK_ADMIN_PASSWORD
default: [randomly generated 10 characters] - the password for the admin user
PIWIK_ADMIN_MAIL
default: [email protected] - only needed if you are interested in one of those newsletters
PIWIK_SUBSCRIBE_NEWSLETTER
1 or 0 - default: 0
PIWIK_SUBSCRIBE_PRO_NEWSLETTER
1 or 0 - default: 0
Website to Track Settings
SITE_NAME
default: My local Website
SITE_URL
default: http://localhost
SITE_TIMEZONE
default: Europe/Berlin
SITE_ECOMMERCE
1 or 0 - default: 0
Piwik Track Settings
ANONYMISE_IP
1 or 0 - this will anonymise IPs - default: 1
DO_NOT_TRACK
1 or 0 - this will skip browsers with do not track enabled from tracking - default: 1
Misc Settings
PIWIK_RELATIVE_URL_ROOT
default: /piwik/ - you can chance that to whatever you want/need
PIWIK_NOT_BEHIND_PROXY
default: not set - if set to any value the settings to listen behind a reverse proxy server will be removed
PIWIK_HSTS_HEADERS_ENABLE
default: not set - if set to any value the HTTP Strict Transport Security will be activated on SSL Channel
PIWIK_HSTS_HEADERS_ENABLE_NO_SUBDOMAINS
default: not set - if set together with PIWIK_HSTS_HEADERS_ENABLE and set to any value the HTTP Strict Transport Security will be deactivated on subdomains
Inherited Variables