初始化管理员账号成功,账号名:"[email protected]",密码:"[email protected]"
启动mogodb:
docker run -itd --name mongo --restart=always --privileged=true -v /data0/app/mongodb/data:/data/db --ip 172.17.0.2 -p 27017:27017 mongo:4.4 --auth
docker exec -it mongodb mongo admin
db.createUser({ user:'root',pwd:'xxxxx',roles:[ { role:'userAdminAnyDatabase', db: 'admin'},'readWriteAnyDatabase']});
//创建yapi数据库 db.createUser({ user: 'yapi', pwd: 'xxxxx', roles: [ { role: "readWrite", db: "yapi" } ] });
docker run -d --name yapi --restart=always --privileged=true -p 3000:3000 -e YAPI_ADMIN_ACCOUNT=[email protected] -e YAPI_ADMIN_PASSWORD=[email protected] -e YAPI_CLOSE_REGISTER=true -e YAPI_DB_SERVERNAME=172.17.0.2 -e YAPI_DB_PORT=27017 -e YAPI_D B_DATABASE=yapi -e YAPI_DB_USER=yapi -e YAPI_DB_PASS=xxxx -e YAPI_DB_AUTH_SOURCE=admin -e YAPI_MAIL_ENABLE=false -e YAPI_PLUGINS=[] tcnetsss/yapi:1.12.2
Content type
Image
Digest
sha256:6251fdf88…
Size
78.3 MB
Last updated
almost 3 years ago
docker pull tcnetsss/yapi:1.12.2