docker 安装 yapi

关键命令如下

docker pull centos

docker run -itd --name yapi --hostname yapi --privileged -e "container=docker" -p 9090:9090 -p 3000:3000 centos /usr/sbin/init

docker exec -it yapi bash

yum -y install wget

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash

source ~/.bashrc

command -v nvm

nvm install v11.12.0

vi /etc/yum.repos.d/mongodb-org-3.4.repo
  [mongodb-org-3.4]
  name=MongoDB Repository
  baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
  gpgcheck=0
  enabled=1

yum install -y mongodb-org

vi /etc/mongod.conf
  bindIp: 0.0.0.0

systemctl start mongod.service

mongo

use yapi

npm install -g yapi-cli --registry https://registry.npm.taobao.org

yapi server
浏览器操作,输入相关信息
初始化管理员账号成功,账号名:"[email protected]",密码:"ymfe.org"
部署成功,请切换到部署目录,输入: "node vendors/server/app.js" 指令启动服务器, 然后在浏览器打开 http://127.0.0.1:3000 访问
输入 ctrl + c 退出安装

进入安装目录:cd /my-yapi/
执行启动命令:nohup node vendors/server/app.js >> /my-yapi/log/start.log 2>&1 &
浏览器操作 yapi,搞掂!

dockeryapi

我来吐槽

*

*