Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

使用独立的MongoDB #1

Closed
chengpeixin opened this issue Jul 10, 2019 · 4 comments
Closed

使用独立的MongoDB #1

chengpeixin opened this issue Jul 10, 2019 · 4 comments
Assignees
Labels
Configuration Some special configurations good first issue Good for newcomers

Comments

@chengpeixin
Copy link

你好,我使用的我自己的数据库,在启动时需要进行验证,这部分在环境变量中可以配置么?

@jinfeijie
Copy link
Owner

jinfeijie commented Jul 10, 2019

@chengpeixin
down完代码后,修改config.json里面的db的内容为如下格式,数据改成你自己的。

  "db": {
    "servername": "127.0.0.1",
    "DATABASE": "yapi",
    "port": 27017,
    "user": "test1",
    "pass": "test1",
    "authSource": ""
  },

修改docker-compose.yml文件为

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=<你的管理员邮箱>
#      - DB_SERVER=<mongoDB的地址>
#      - DB_NAME=<对应的DBName>
#      - DB_PORT=<mongoDB的端口>
    # restart: always
    ports:
      - 127.0.0.1:3000:3000
    volumes:
      - ~/data/yapi/log/yapi.log:/home/vendors/log # log dir
    entrypoint: "bash  entrypoint.sh"
    networks:
      - back-net
networks:
  back-net:
    external: true

@chengpeixin
Copy link
Author

好的,非常感谢

@jinfeijie jinfeijie added the good first issue Good for newcomers label Jul 11, 2019
@jinfeijie jinfeijie self-assigned this Jul 11, 2019
@jinfeijie jinfeijie pinned this issue Jul 11, 2019
@jinfeijie jinfeijie changed the title 数据库需要验证? 使用独立的MongoDB Jul 11, 2019
@jinfeijie jinfeijie added the Configuration Some special configurations label Jul 11, 2019
@jinfeijie jinfeijie reopened this Jul 13, 2019
@callmeioy
Copy link

@chengpeixin
down完代码后,修改config.json里面的db的内容为如下格式,数据改成你自己的。

  "db": {
    "servername": "127.0.0.1",
    "DATABASE": "yapi",
    "port": 27017,
    "user": "test1",
    "pass": "test1",
    "authSource": ""
  },

修改docker-compose.yml文件为

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=<你的管理员邮箱>
#      - DB_SERVER=<mongoDB的地址>
#      - DB_NAME=<对应的DBName>
#      - DB_PORT=<mongoDB的端口>
    # restart: always
    ports:
      - 127.0.0.1:3000:3000
    volumes:
      - ~/data/yapi/log/yapi.log:/home/vendors/log # log dir
    entrypoint: "bash  entrypoint.sh"
    networks:
      - back-net
networks:
  back-net:
    external: true

其实我想用你的镜像,能够直接加 mongoDB 数据库账号和密码,目前用的镜像,数据库就得公开无密码,你的docker-compose.yml加多这两个选项可以么,不想自己还去build镜像,就是想直接用你的

@jinfeijie
Copy link
Owner

jinfeijie commented Jul 1, 2021 via email

@u5de6 u5de6 mentioned this issue Mar 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Configuration Some special configurations good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants