yapi-docker部署

yapi-docker部署

部署步骤

使用DockerCompose构建部署Yapi.md

填坑

docker images生成部署时。发现docker-entrypoint.sh没有初始化数据库,只有运行代码,没有添加初始化命令:

npm run install-server //安装程序,初始化数据库索引和管理员账号,管理员账号名可在 config.json 配置`

补救措施:

1
2
3
4
5
6
[root@VM-4-16-centos /]# docker exec -it 2e43588c8b1f bash
root@2e43588c8b1f:/# node api/vendors/server/install.js
(node:65) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
log: mongodb load success...
初始化管理员账号成功,账号名:"xxxxx@gmail.com",密码:"ymfe.org"

config.json内容如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
{
"port": "3000",
"adminAccount": "admin@admin.com",//yapi管理员账号
"timeout":120000,
"db": {
"servername": "192.168.0.1",
"DATABASE": "yapi",
"port": 27017,
"user": "yapi",
"pass": "123456",
"authSource": ""
}
}

参考

Docker部署YApi和使用问题
顶尖 API 文档管理工具 (YAPI)

作者

zhang

发布于

2021-08-14

更新于

2023-09-19

许可协议

CC BY-NC-SA 4.0

Your browser is out-of-date!

Update your browser to view this website correctly.&npsb;Update my browser now

×