docker 容器 matomo 装置
- docker pull mysql:5.7.25
- docker pull matomo
容器目录配置
mkdir -pv /home/[matomodockerfile](http://matomodockerfile/var/www/html)
mkdir -pv /home/mysql-matomo5.7.25/data/
mkdir -pv /home/mysql-matomo5.7.25/conf/
docker mysql5.7.25 的配置文件
cat /home/mysql-matomo5.7.25/data/my.cnf //mysql5.7 的配置文件
[client]
port = 3306
socket = /tmp/mysql.sock
[mysqld]
server-id = 1
port = 3306
datadir = /var/lib/mysql
tmpdir = /tmp
socket = /tmp/mysql.sock
skip-external-locking
skip_name_resolve = 1
transaction_isolation = READ-COMMITTED
character-set-server = utf8mb4
collation-server = utf8mb4_general_ci
init_connect='SET NAMES utf8mb4'
lower_case_table_names = 1
max_connections = 400
max_connect_errors = 1000
explicit_defaults_for_timestamp = true
max_allowed_packet = 128M
interactive_timeout = 1800
wait_timeout = 1800
tmp_table_size = 134217728
max_heap_table_size = 134217728
query_cache_size = 0
query_cache_type = 0
sort_buffer_size = 2097152
binlog_cache_size = 524288
back_log = 130
log_error = error.log
log_queries_not_using_indexes = 1
log_throttle_queries_not_using_indexes = 5
long_query_time = 8
min_examined_row_limit = 100
expire_logs_days = 5
master_info_repository = TABLE
relay_log_info_repository = TABLE
innodb_buffer_pool_size = 1G
innodb_flush_method = O_DIRECT
innodb_file_format = Barracuda
innodb_write_io_threads = 4
innodb_read_io_threads = 4
innodb_io_capacity = 500
innodb_lock_wait_timeout = 30
innodb_buffer_pool_dump_pct = 40
innodb_print_all_deadlocks = 1
[mysqldump]
quick
max_allowed_packet = 128M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 20M
sort_buffer_size = 256k
read_buffer = 2M
write_buffer = 2M
[mysqlhotcopy]
interactive-timeout
[mysqld_safe]
open-files-limit = 28192
容器启动
docker run -d -p 3306:3306 -e MYSQL_ROOT_PASSWORD=xxxxxx --privileged=true --restart=always --name mysql-matomo5.7.25 -v /home/mysql-matomo5.7.25/conf/:/etc/mysql/ -v /home/mysql-matomo5.7.25/data/:/var/lib/mysql [docker.io/mysql:5.7.25](http://docker.io/mysql:5.7.25)
docker run -d --link mysql-matomo5.7.25:db --restart=always --name matomo -v /home/[matomodockerfile:/var/www/html](http://matomodockerfile/var/www/html) -p 80:80 matomo:latest // 启动 matomo
docker ps
7ca5d8353500 matomo:latest "/entrypoint.sh apac…" 26 minutes ago Up 26 minutes 0.0.0.0:80->80/tcp matomo
51676564dc10 mysql:5.7.25 "docker-entrypoint.s…" 46 hours ago Up 27 minutes 0.0.0.0:3306->3306/tcp, 33060/tcp mysql-matomo5.7.25
拜访 ip