Dockerfile to build a matomo container image. It is an Open Source Google Analytics Replacement.
It will automatically download the latest Piwik release upon build, and if you have set correct environment variables, will autocreate a database if you wish.
This Container uses Alpine:Edge as a base. Additional Components are PHP7 w/ APC, OpCache, LDAP Support - MySQL Client is also available.
- [Dave Conroy][https://github.com/tiredofit]
- About
- Maintainer
- Table of Contents
- Prerequisites and Assumptions
- Installation
- Configuration
- Maintenance
- References
This image relies on an external MySQL Server, external SMTP Server, external Redis Server and is meant to be run behind a reverse SSL Proxy such as nginx-proxy.
Automated builds of the image are available on Registry
docker pull docker.io/tiredofit/matomo
-
The quickest way to get started is using docker-compose. See the examples folder for a working docker-compose.yml that can be modified for development or production use.
-
Set various environment variables to understand the capabilities of this image.
-
Map persistent storage for access to configuration and data files for backup.
The following directories are used for configuration and can be mapped for persistent storage.
Directory | Description |
---|---|
/www/matomo |
Root matomo Directory |
/www/logs |
Nginx and php-fpm logfiles |
This container requires the usage of an external database. Set one up accordingly.
CREATE USER 'matomo'@'%.%.%.%' IDENTIFIED BY 'password';
CREATE DATABASE IF NOT EXISTS `matomo` DEFAULT CHARACTER SET `utf8` COLLATE `utf8_unicode_ci`;
GRANT ALL PRIVILEGES ON `matomo`.* TO 'matomo'@'%.%.%.%';
Below is the complete list of available options that can be used to customize your installation.
Parameter | Description | Default | _FILE |
---|---|---|---|
DB_HOST |
MySQL external container hostname (e.g. matomo1-db) | x | |
DB_NAME |
MySQL database name i.e. (e.g. matomo) | x | |
DB_USER |
MySQL username for database (e.g. matomo) | x | |
DB_PASS |
MySQL password for database (e.g. userpassword) | x |
The following ports are exposed.
Port | Description |
---|---|
80 |
HTTP |
For debugging and maintenance purposes you may want access the containers shell.
docker exec -it (whatever your container name is e.g. matomo) bash