Giter Site home page Giter Site logo

yapi's Introduction

Docker for YApi

一键部署YApi

Build Status License

⚠️注意

⚠️注意:本仓库目前只支持安装,暂不支持升级,请知晓。如需升级请备份mongoDB内的数据。

使用

默认密码是:ymfe.org,安装成功后进入后台修改

可修改变量

环境变量 默认值 建议
VERSION 1.10.2 强烈建议升级
HOME /home 可修改
PORT 3000 可修改
ADMIN_EMAIL [email protected] 建议修改
DB_SERVER mongo(127.0.0.1) 不建议修改
DB_NAME yapi 不建议修改
DB_PORT 27017 不建议修改
VENDORS ${HOME}/vendors 不建议修改

获取本镜像

🚘获取本镜像:docker pull mrjin/yapi:latest

docker-compose 部署

version: '2.1'
services:
  yapi:
    image: mrjin/yapi:latest
    # build: ./
    container_name: yapi
    environment:
      - VERSION=1.10.2
      - LOG_PATH=/tmp/yapi.log
      - HOME=/home
      - PORT=3000
      - [email protected]
      - 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

Nginx 配置

server {
    listen     80;
    server_name your.domain;
    keepalive_timeout   70;

    location / {
        proxy_pass http://yapi:3000;
    }
    location ~ /\. {
        deny all;
    }
}

启动方法

  1. 修改docker-compose.yml文件里面相关参数

  2. 创建network:docker network create back-net

  3. 启动服务:docker-compose up -d

✨欢迎 Star && Fork

yapi's People

Contributors

dependabot-preview[bot] avatar jinfeijie avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.