docker-compose部署yapi服务

1.创建docker-compose.yml文件

version: '2.1'
services:
  yapi:
    image: mrjin/yapi:latest
    # build: ./
    container_name: yapi
    restart: always
    environment:
      - VERSION=1.9.3
      - LOG_PATH=/tmp/yapi.log
      - HOME=/home
      - PORT=3008
      - ADMIN_EMAIL=xxxxxx@qq.com
      - DB_SERVER=mongo
      - DB_NAME=yapi
      - DB_PORT=27017
    ports:
      - 5000:3008
    volumes:
      - ./logs:/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:
      - 5001:27017
    volumes:
      - ./data:/data/db #db dir
  1. 执行
docker-compose up -d

3.访问:

http://ip:5000/

4.Yapi文档地址

1. https://github.com/YMFE/yapi
2. https://hellosean1025.github.io/yapi/

你可能感兴趣的:(docker,docker,容器,运维)