mirror of
https://github.com/nickyeoman/docker-compose-cookbooks.git
synced 2026-09-03 18:36:22 +00:00
matomo updated to current template
This commit is contained in:
@@ -0,0 +1,74 @@
|
||||
# Matomo Web Analytics
|
||||
|
||||
## Overview
|
||||
|
||||
Matomo is an open-source web analytics platform. This stack runs Matomo with a MariaDB database.
|
||||
|
||||
## Project Details
|
||||
|
||||
- **Project Repository:** [https://github.com/matomo-org/matomo](https://github.com/matomo-org/matomo)
|
||||
- **Container Image:** [Docker Hub](https://hub.docker.com/_/matomo)
|
||||
- **Documentation:** [https://matomo.org/docs](https://matomo.org/docs)
|
||||
- **Reverse Proxy Port:** `80`
|
||||
|
||||
## Getting Started
|
||||
|
||||
1. Start the stack: `docker compose up -d`
|
||||
2. Open http://localhost:${MATOMO_PORT:-8080} in your browser
|
||||
3. Follow the web setup wizard, using database host `matomo-db`
|
||||
|
||||
## Environment Variable Notes
|
||||
|
||||
VOL_PATH – base path for persistent data volumes
|
||||
VOL_PROJECTS – base path for project directories
|
||||
MATOMO_IMAGE – Matomo container image (default: matomo:latest)
|
||||
MATOMO_RESTART – restart policy (default: unless-stopped)
|
||||
MATOMO_PORT – host port mapped to container port 80 (default: 8080)
|
||||
MATOMO_DB_IMAGE – MariaDB container image (default: mariadb:10.4)
|
||||
MATOMO_MYSQL_ROOT_PASSWORD – MariaDB root password
|
||||
MATOMO_MYSQL_PASSWORD – MariaDB matomo user password
|
||||
MATOMO_DB_PASSWORD – Matomo's database password (must match MATOMO_MYSQL_PASSWORD)
|
||||
|
||||
## Volume Notes
|
||||
|
||||
${VOL_PATH}/matomo_dev/db – MariaDB data directory
|
||||
${VOL_PATH}/matomo_dev/html – Matomo application files
|
||||
${VOL_PATH}/matomo_dev/config – Matomo configuration
|
||||
${VOL_PATH}/matomo_dev/logs – Matomo log files
|
||||
|
||||
## Network Notes
|
||||
|
||||
Requires the external `proxy` network (Nginx Proxy Manager). An internal bridge network `internal` is created for inter-service communication.
|
||||
|
||||
## Docker Run
|
||||
|
||||
```bash
|
||||
docker run -d \
|
||||
--name matomo \
|
||||
-v ${VOL_PATH:-/data}/matomo_dev/html:/var/www/html \
|
||||
-v ${VOL_PATH:-/data}/matomo_dev/config:/var/www/html/config \
|
||||
-v ${VOL_PATH:-/data}/matomo_dev/logs:/var/www/html/logs \
|
||||
-e MATOMO_DB_HOST=matomo-db \
|
||||
-e MATOMO_DB_USER=matomo \
|
||||
-e MATOMO_DB_PASSWORD=changeme \
|
||||
-e MATOMO_DB_NAME=matomo \
|
||||
-p 8080:80 \
|
||||
--network proxy \
|
||||
matomo:latest
|
||||
```
|
||||
|
||||
## Additional Notes / Gotchas
|
||||
|
||||
- On first run, Matomo will guide you through the setup wizard. Use `matomo-db` as the database host.
|
||||
- The `MATOMO_DB_PASSWORD` env var must match the `MYSQL_PASSWORD` set for the MariaDB matomo user.
|
||||
|
||||
## Dockhand Stack, Deploy from Git
|
||||
|
||||
Cookbooks Repository
|
||||
stackname: MATOMO_DEV
|
||||
Compose file path: matomo_dev/compose.yaml
|
||||
Additional env file (optional): matomo_dev/sample.env
|
||||
|
||||
Then "Load" matomo_dev/sample.env into the Environmental variables in dockhand
|
||||
|
||||
Create the Stack
|
||||
@@ -1,4 +0,0 @@
|
||||
# matomo
|
||||
|
||||
Examples:
|
||||
https://github.com/matomo-org/docker/blob/master/.examples/apache/docker-compose.yml
|
||||
@@ -0,0 +1,49 @@
|
||||
# Matomo Web Analytics
|
||||
|
||||
services:
|
||||
matomo-db:
|
||||
image: ${MATOMO_DB_IMAGE:-mariadb:10.4}
|
||||
restart: ${MATOMO_RESTART:-unless-stopped}
|
||||
|
||||
volumes:
|
||||
- ${VOL_PATH:-/data}/matomo_dev/db:/var/lib/mysql
|
||||
|
||||
environment:
|
||||
- MYSQL_ROOT_PASSWORD=${MATOMO_MYSQL_ROOT_PASSWORD:-changeme}
|
||||
- MYSQL_DATABASE=matomo
|
||||
- MYSQL_USER=matomo
|
||||
- MYSQL_PASSWORD=${MATOMO_MYSQL_PASSWORD:-changeme}
|
||||
|
||||
networks:
|
||||
- internal
|
||||
|
||||
matomo:
|
||||
image: ${MATOMO_IMAGE:-matomo:latest}
|
||||
restart: ${MATOMO_RESTART:-unless-stopped}
|
||||
|
||||
volumes:
|
||||
- ${VOL_PATH:-/data}/matomo_dev/html:/var/www/html
|
||||
- ${VOL_PATH:-/data}/matomo_dev/config:/var/www/html/config
|
||||
- ${VOL_PATH:-/data}/matomo_dev/logs:/var/www/html/logs
|
||||
|
||||
environment:
|
||||
- MATOMO_DB_HOST=matomo-db
|
||||
- MATOMO_DB_USER=matomo
|
||||
- MATOMO_DB_PASSWORD=${MATOMO_DB_PASSWORD:-changeme}
|
||||
- MATOMO_DB_NAME=matomo
|
||||
|
||||
ports:
|
||||
- "${MATOMO_PORT:-8080}:80"
|
||||
|
||||
networks:
|
||||
- proxy
|
||||
- internal
|
||||
|
||||
depends_on:
|
||||
- matomo-db
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
internal:
|
||||
driver: bridge
|
||||
@@ -1,31 +0,0 @@
|
||||
# matomo
|
||||
|
||||
services:
|
||||
matomodb:
|
||||
image: mariadb:${DB_V}
|
||||
restart: ${MATOMO_RESTART:-always}
|
||||
volumes:
|
||||
- ${VOL_PATH:-/data}/matomodb:/var/lib/mysql
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: ${MATOMO_MYSQL_ROOT_PASSWORD:-12345678}
|
||||
MYSQL_PASSWORD: ${MATOMO_MYSQL_PASSWORD:-987654321}
|
||||
MYSQL_DATABASE: matomo
|
||||
MYSQL_USER: matomo
|
||||
matomo:
|
||||
image: matomo:${MATOMO_V}
|
||||
restart: ${MATOMO_RESTART:-always}
|
||||
volumes:
|
||||
- ${VOL_PATH:-/data}/matomo:/var/www/html
|
||||
- ${VOL_PATH:-/data}/matomoconfig:/var/www/html/config
|
||||
- ${VOL_PATH:-/data}/matatomologs:/var/www/html/logs
|
||||
environment:
|
||||
MATOMO_DB_HOST: matomodb
|
||||
MATOMO_DB_USER: matomo
|
||||
MATOMO_DB_PASSWORD: ${MATOMO_DB_PASSWORD:-matomo}
|
||||
MATOMO_DB_NAME: matomo
|
||||
|
||||
networks:
|
||||
proxy:
|
||||
external: true
|
||||
db:
|
||||
driver: bridge
|
||||
@@ -1,11 +0,0 @@
|
||||
# Domains & Project
|
||||
PREFIX=p1
|
||||
MATOMO_DOMAIN_NAME=matomo.nickyeoman.com
|
||||
|
||||
# Passwords
|
||||
MATOMO_MYSQL_ROOT_PASSWORD=ChangeMe2ASecurepass!
|
||||
MATOMO_MYSQL_PASSWORD=Again2ASecurepass!
|
||||
|
||||
# Software versions
|
||||
DB_V=10.4.0
|
||||
MATOMO_V=3.13.5-apache
|
||||
@@ -0,0 +1,14 @@
|
||||
# ===== Paths =====
|
||||
VOL_PATH=/data
|
||||
VOL_PROJECTS=/data/projects
|
||||
|
||||
# ===== Matomo =====
|
||||
MATOMO_IMAGE=matomo:latest
|
||||
MATOMO_RESTART=unless-stopped
|
||||
MATOMO_PORT=8080
|
||||
|
||||
# ===== Database =====
|
||||
MATOMO_DB_IMAGE=mariadb:10.4
|
||||
MATOMO_MYSQL_ROOT_PASSWORD=changeme-root
|
||||
MATOMO_MYSQL_PASSWORD=changeme
|
||||
MATOMO_DB_PASSWORD=changeme
|
||||
Reference in New Issue
Block a user