# 【转载】Docker搭建访问统计工具Matomo

## 来源

咕咕鸽：https://blog.laoda.de/archives/docker-compose-install-matomo

## 部署

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28

    version: "3"

    services:
      matomo_db:
        image: mariadb
        command: --max-allowed-packet=64MB
        restart: always
        volumes:
          - ./db:/var/lib/mysql
        environment:
          - MYSQL_ROOT_PASSWORD=Pas3W0rd
        env_file:
          - ./db.env

      matomo_app:
        image: matomo
        restart: always
        volumes:
    #     - ./config:/var/www/html/config
    #     - ./logs:/var/www/html/logs
          - ./html:/var/www/html
        environment:
          - MATOMO_DATABASE_HOST=matomo_db
        env_file:
          - ./db.env
        ports:
          - 18080:80  # 8080可以更改为别的未使用的端口  lsof -i:8080 可以查看8080端口是否被使用
          - 18443:443 # 8443可以更改为别的未使用的端口  这边后续填到NPM的“Custom location”里

- mkdir matomo && cd matomo
- nano docker-compose.yml
- nano db.env
- docker-compose up -d
- 反代18080端口
- 将统计代码添加到主题设置里

    1
    2
    3
    4
    5
    6
    7
    8

    MYSQL_PASSWORD=Pas3W0rd
    MYSQL_DATABASE=matomo
    MYSQL_USER=matomo
    MATOMO_DATABASE_ADAPTER=mysql
    MATOMO_DATABASE_TABLES_PREFIX=matomo_
    MATOMO_DATABASE_USERNAME=matomo
    MATOMO_DATABASE_PASSWORD=Pas3W0rd
    MATOMO_DATABASE_DBNAME=matomo

转载
【转载】Docker搭建访问统计工具Matomo
https://occdn.limour.top/2071.html
Author
Limour
Posted on
July 11, 2022
Licensed under
【转载】Wallabag+TTRSS+FeedMe Previous
NPM面板：反代阿里云OSS Next

#### Search

Keyword