获取YApi镜像
$ docker pull mrjin/yapi:latest
注意:本仓库目前只支持安装,暂不支持升级,请知晓。如需升级请备份mongoDB内的数据。
docker-compose 部署
version: '2.1'
services:
yapi:
image: mrjin/yapi:latest
# build: ./
container_name: yapi
environment:
- VERSION=1.5.6
- LOG_PATH=/tmp/yapi.log
- HOME=/home
- PORT=3000
- ADMIN_EMAIL=admin@yapi.cn
- DB_SERVER=mongo
- DB_NAME=yapi
- DB_PORT=27017
restart: always
ports:
- 3000:3000
volumes:
- /data/yapi/log/yapi.log:/home/vendors/log # log dir
depends_on:
- mongo
entrypoint: "bash /wait-for-it.sh mongo:27017 -- entrypoint.sh"
mongo:
image: mongo
container_name: mongo
restart: always
ports:
- 27017:27017
volumes:
- /data/yapi/mongodb:/data/db #db dir
启动docker-compose
$ docker-compose up
$ docker-compose up -d
查看日志
$ docker ps
$ docker logs -f --tail=1000 mongo
$ docker logs -f --tail=1000 yapi
重启mongo/yapi
$ docker restart mongo
$ docker restart yapi
默认用户名/密码:me@jinfeijie.cn/ymfe.org,安装成功后进入后台修改
yapi github
https://github.com/jinfeijie/yapi