Files
Mickael Asseline 7abe8b25e1 Update matomo.yml
2024-05-16 23:47:30 +02:00

77 lines
2.3 KiB
YAML

# Maintainer: Mickael "PAPAMICA" Asseline
# Update: 2022-05-10
#& type: 3
#& title: Matomo
#& description: Google Analitycs alternative !
#& note: Website: <a href='https://fr.matomo.org' target='_blank' rel='noopener'>Matomo.org</a>
#& categories: SelfHosted, PAPAMICA
#& platform: linux
#& logo: https://img.papamica.com/logo/matomo.png
#% SERVICE: Name of the service (No spaces or points) [matomo]
#% DATA_LOCATION: Data localization (Example: /apps/service) [/_data/apps]
#% URL: Service URL (Example: service.papamica.fr or service.com)
#% NETWORK: Your Traefik network (Example: proxy) [proxy]
#% DB_USER: Database user (No spaces or points) [matomo]
#% DB_PASSWORD: Database user password
version: "2"
services:
# Matomo : https://fr.matomo.org
matomo:
image: matomo:latest
container_name: $SERVICE
restart: unless-stopped
environment:
- MATOMO_DATABASE_HOST=$SERVICE-db
- MATOMO_DATABASE_DBNAME=matomo
- MATOMO_DATABASE_USERNAME=$DB_USER
- MATOMO_DATABASE_PASSWORD=$DB_PASSWORD
healthcheck:
test: curl --fail http://localhost:80 || exit 1
interval: 1m
timeout: 30s
retries: 3
volumes:
- $DATA_LOCATION/$SERVICE/data:/var/www/html matomo
depends_on:
- matomo-db
networks:
- default
labels:
- "autoupdate=monitor" # https://github.com/PAPAMICA/container-updater
- "traefik.enable=true"
- "traefik.http.routers.$SERVICE.entrypoints=https"
- "traefik.http.routers.$SERVICE.rule=Host(`$URL`)"
- "traefik.http.routers.$SERVICE.tls=true"
- "traefik.http.routers.$SERVICE.tls.certresolver=http"
- "traefik.docker.network=$NETWORK"
matomo-db:
image: linuxserver/mariadb
container_name: $SERVICE-db
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
- MYSQL_ROOT_PASSWORD=$DB_PASSWORD
- MYSQL_DATABASE=matomo
- MYSQL_USER=$DB_USER
- MYSQL_PASSWORD=$DB_PASSWORD
- MARIADB_EXTRA_FLAGS=--max_allowed_packet=64MB
volumes:
- $DATA_LOCATION/$SERVICE/db:/config
networks:
- default
labels:
- "autoupdate=monitor" # https://github.com/PAPAMICA/container-updater
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"]
timeout: 20s
retries: 10
networks:
default:
external: true
name: $NETWORK