docker pull yapipro/yapi:latest
mkdir -p /root/yapi/conf
nano /root/yapi/conf/config.json
=================================={"port": "3000","adminAccount": "admin@gmail.com","timeout":120000,"db": {"servername": "192.168.31.135","DATABASE": "yapi","port": 27017,"user": "root","pass": "123","authSource": "admin"},"mail": {"enable": true,"host": "smtp.gmail.com","port": 465,"from": "*","auth": {"user": "admin@gmail.com","pass": "admin"}}}
==================================#初始化数据库表
docker run -d --rm \--name yapi-init \-v /root/yapi/conf/config.json:/yapi/config.json \yapipro/yapi:latest \server/install.js
#启动yapi
docker run -d \--name yapi \--restart always \-p 3000:3000 \-v /root/yapi/conf/config.json:/yapi/config.json \yapipro/yapi:latest \server/app.js
mongodb数据初始化:
#登录
http://192.168.31.143:3000/
用户名:admin@gmail.com
初始密码:yapi.pro