Introduction
We recommend an open source interface management platform YApi, many manufacturers are using the Internet
YApi of some customers: Baidu, Alibaba, Tencent, etc. Today's headlines
GitHub address: https: //github.com/YMFE/yapi
There are tutorials locally installed on github, because docker installation more convenient, thus officially recommended the following docker installation tutorial, of course docker image is not official to do. Ali cloud mirrored configuration recommended Docker warehouse, download it faster
Use Docker build YApi
1. Start the MongoDB
docker run -d --name mongo-yapi mongo
2. Get Yapi mirroring, version information can be viewed in a mirror Ali cloud repository
docker pull registry.cn-hangzhou.aliyuncs.com/anoy/yapi
3. Initialize the index and database administrator account Yapi
docker run -it --rm \
--link mongo-yapi:mongo \
--entrypoint npm \
--workdir /api/vendors \
registry.cn-hangzhou.aliyuncs.com/anoy/yapi \
run install-server
Custom profile mount to the directory /api/config.json, official custom profile
https://github.com/YMFE/yapi/blob/master/config_example.json
4. Start Yapi Service
docker run -d \
--name yapi \
--link mongo-yapi:mongo \
--workdir /api/vendors \
-p 3000:3000 \
registry.cn-hangzhou.aliyuncs.com/anoy/yapi \
server/app.js
Use Yapi
Visit http: // localhost: 3000 login account [email protected], password ymfe.org
So far, handsome YApi can easily use it! For more document information, please refer to
YApi official tutorial
https://hellosean1025.github.io/yapi/documents/index.html
YApi version update records
https://github.com/YMFE/yapi/blob/master/CHANGELOG.md
Other related operations
1. Turn off YApi
docker stop yapi
2. Start YApi
docker start yapi
3. Upgrade YApi
# 1、停止并删除旧版容器
docker rm -f yapi
# 2、获取最新镜像
docker pull registry.cn-hangzhou.aliyuncs.com/anoy/yapi
# 3、启动新容器
docker run -d \
--name yapi \
--link mongo-yapi:mongo \
--workdir /api/vendors \
-p 3000:3000 \
registry.cn-hangzhou.aliyuncs.com/anoy/yapi \
server/app.js
Construction of YApi mirror manual
1. Download YApi to local
wget -o yapi.tar.gz https://github.com/YMFE/yapi/archive/v1.8.0.tar.gz
Download: https: //github.com/YMFE/yapi/releases
2. Edit Dockerfile
FROM node:12-alpine as builder
RUN apk add --no-cache git python make openssl tar gcc
COPY yapi.tar.gz /home
RUN cd /home && tar zxvf yapi.tar.gz && mkdir /api && mv /home/yapi-1.8.0 /api/vendors
RUN cd /api/vendors && \
npm install --production --registry https://registry.npm.taobao.org
FROM node:12-alpine
MAINTAINER [email protected]
ENV TZ="Asia/Shanghai" HOME="/"
WORKDIR ${HOME}
COPY --from=builder /api/vendors /api/vendors
COPY config.json /api/
EXPOSE 3000
ENTRYPOINT ["node"]
3. Build Mirror
docker build -t yapi .