Docker 安装 Yapi接口文档
- touch docker-compose.yml文件
- 可以修改docker-compose.yml中yapi-web下的环境变量 YAPI_ADMIN_ACCOUNT为管理员邮箱,YAPI_ADMIN_PASSWORD为管理员密码
- 执行 docker-compose up -d 启动服务
- 开放yapi 3000端口 ip:3000访问
docker-compose.yml 文件内容
version: '3'
services:
yapi-web:
image: jayfong/yapi:latest
container_name: yapi-web
ports:
- 3000:3000
environment:
- YAPI_ADMIN_ACCOUNT=admin@docker.yapi
- YAPI_ADMIN_PASSWORD=admin
- YAPI_CLOSE_REGISTER=true
- YAPI_DB_SERVERNAME=yapi-mongo
- YAPI_DB_PORT=27017
- YAPI_DB_DATABASE=yapi
- YAPI_MAIL_ENABLE=false
- YAPI_LDAP_LOGIN_ENABLE=false
- YAPI_PLUGINS=[]
depends_on:
- yapi-mongo
links:
- yapi-mongo
networks:
- yapi
restart: unless-stopped
yapi-mongo:
image: mongo:latest
container_name: yapi-mongo
volumes:
- ./data/db:/data/db
networks:
- yapi
expose:
- 27017
restart: unless-stopped
networks:
yapi: