一键部署YApi
JimCY [me@jinfeijie.cn]
默认密码是:ymfe.org
,安装成功后进入后台修改
环境变量 | 默认值 | 建议 |
---|---|---|
VERSION | 1.5.6 | 可以修改成yapi已发布的版本 |
HOME | /home | 可修改 |
PORT | 3000 | 可修改 |
ADMIN_EMAIL | me@jinfeijie.cn | 建议修改 |
DB_SERVER | mongo(127.0.0.1) | 不建议修改 |
DB_NAME | yapi | 不建议修改 |
DB_PORT | 27017 | 不建议修改 |
VENDORS | ${HOME}/vendors | 不建议修改 |
🚘获取本镜像:docker pull mrjin/yapi:latest
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=me@jinfeijie.cn
- DB_SERVER=mongo
- DB_NAME=yapi
- DB_PORT=27017
# restart: always
ports:
- 127.0.0.1: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"
networks:
- back-net
mongo:
image: mongo
container_name: mongo
# restart: always
ports:
- 127.0.0.1:27017:27017
volumes:
- ~/data/yapi/mongodb:/data/db #db dir
networks:
- back-net
networks:
back-net:
external: true
server {
listen 80;
server_name your.domain;
keepalive_timeout 70;
location / {
proxy_pass http://yapi:3000;
}
location ~ /\. {
deny all;
}
}
-
修改
docker-compose.yml
文件里面相关参数 -
创建network:
docker network create back-net
-
启动服务:
docker-compose up -d
📧联系@jinfeijie
✨欢迎 Star && Fork