【Amadeus原创】Docker安装wikijs wiki系统

  1. 拉取mysql8的镜像并运行

docker pull mysql

docker run -d -v /data/mysql/data:/var/lib/mysql -v /data/mysql/conf:/etc/mysql/conf.d --name mysql -e TZ=Asia/Shanghai -e MYSQL_ROOT_PASSWORD=1234 -p 3306:3306 mysql:latest

  1. 进入mysql,创建并修改权限

docker exec -it mysql bash
mysql -uroot -p

use mysql;
create user 'wiki'@'localhost' identified by 'vegasd1234';
create user 'wiki'@'%' identified by 'vegasd1234';

create database `wiki`;

grant all privileges on wiki.* to 'wiki'@'localhost';
grant all privileges on wiki.* to 'wiki'@'%';
flush privileges; select host,user,authentication_string,plugin from user;
alter user 'wiki'@'%' identified with mysql_native_password by 'vegasd1234';

  1. 拉取wiki.js镜像并运行

docker pull requarks/wiki

docker run -d -p 82:3000 --name wiki --restart unless-stopped -e "DB_TYPE=mysql" -e "DB_HOST=10.1.0.105" -e "DB_PORT=3306" -e "DB_USER=wiki" -e "DB_PASS=vegasd1234" -e "DB_NAME=wiki" requarks/wiki:latest

  1. 打开浏览器,访问http://10.1.0.105:82/   进行设置,即可。

image

posted @ 2021-08-18 17:12  李济宏(Amadeus)  阅读(673)  评论(0编辑  收藏  举报