https://github.com/tiredofit/docker-matomo
Dockerized web analytics
https://github.com/tiredofit/docker-matomo
alpine analytics docker nginx php-fpm piwik
Last synced: 9 months ago
JSON representation
Dockerized web analytics
- Host: GitHub
- URL: https://github.com/tiredofit/docker-matomo
- Owner: tiredofit
- License: mit
- Created: 2017-08-23T03:15:04.000Z (over 8 years ago)
- Default Branch: main
- Last Pushed: 2024-01-26T20:48:30.000Z (almost 2 years ago)
- Last Synced: 2025-03-21T02:22:03.177Z (9 months ago)
- Topics: alpine, analytics, docker, nginx, php-fpm, piwik
- Language: Dockerfile
- Homepage:
- Size: 48.8 KB
- Stars: 9
- Watchers: 4
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# tiredofit/matomo
## About
Dockerfile to build a [matomo](https://www.matomo.org/) 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.
[Changelog](CHANGELOG.md)
## Maintainer
- [Dave Conroy][https://github.com/tiredofit]
## Table of Contents
- [About](#about)
- [Maintainer](#maintainer)
- [Table of Contents](#table-of-contents)
- [Prerequisites and Assumptions](#prerequisites-and-assumptions)
- [Installation](#installation)
- [Quick Start](#quick-start)
- [Configuration](#configuration)
- [Persistent Storage](#persistent-storage)
- [Database](#database)
- [Environment Variables](#environment-variables)
- [Networking](#networking)
- [Maintenance](#maintenance)
- [Shell Access](#shell-access)
- [References](#references)
## Prerequisites and Assumptions
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.
## Installation
Automated builds of the image are available on [Registry](https://hub.docker.com/r/tiredofit/matomo)
```bash
docker pull docker.io/tiredofit/matomo
```
### Quick Start
* The quickest way to get started is using [docker-compose](https://docs.docker.com/compose/). See the examples folder for a working [docker-compose.yml](examples/docker-compose.yml) that can be modified for development or production use.
* Set various [environment variables](#environment-variables) to understand the capabilities of this image.
* Map [persistent storage](#data-volumes) for access to configuration and data files for backup.
## Configuration
### Persistent Storage
The following directories are used for configuration and can be mapped for persistent storage.
| Directory | Description |
| ------------- | -------------------------- |
| `/www/matomo` | Root matomo Directory |
| `/var/log/unit` | Nginx Unit logfiles |
### Database
This container requires the usage of an external database. Set one up accordingly.
```sql
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'@'%.%.%.%';
```
### Environment Variables
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 |
### Networking
The following ports are exposed.
| Port | Description |
| ---- | ----------- |
| `80` | HTTP |
## Maintenance
### Shell Access
For debugging and maintenance purposes you may want access the containers shell.
```bash
docker exec -it (whatever your container name is e.g. matomo) bash
```
## References
* https://www.matomo.org