mkdir /www/dockerCompose/yapi/
cd /www/dockerCompose/yapi/
vim docker-compose.yml
version: '3' services: yapi-web: image: liuqingzheng/yapi:latest container_name: yapi-web ports: - 3000:3000 environment: - YAPI_ADMIN_ACCOUNT=123@qq.com - 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 restart: unless-stopped yapi-mongo: image: mongo:latest container_name: yapi-mongo volumes: - ./data/db:/data/db expose: - 27017
管理命令:
docker-compose up -d # 启动 docker-compose stop # 停止 docker-compose rm # 删除
后台地址:
http://127.0.0.1:3000/ 输入邮箱:123@qq.com 输入密码:admin