Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

如何更改 MongoDB 默认端口 #90

Open
liangyuanzu opened this issue Jan 25, 2022 · 0 comments
Open

如何更改 MongoDB 默认端口 #90

liangyuanzu opened this issue Jan 25, 2022 · 0 comments

Comments

@liangyuanzu
Copy link

liangyuanzu commented Jan 25, 2022

我的 docker-compose.yml 文件配置

  yapi-web:
    image: jayfong/yapi:latest
    container_name: yapi-web
    ports:
      - 40001:3000
    environment:
      - YAPI_ADMIN_ACCOUNT=xxx
      - YAPI_ADMIN_PASSWORD=xxx
      - YAPI_CLOSE_REGISTER=true
      - YAPI_DB_SERVERNAME=yapi-mongo
      - YAPI_DB_PORT=37017
      - YAPI_DB_DATABASE=yapi
      - YAPI_MAIL_ENABLE=false
      - YAPI_LDAP_LOGIN_ENABLE=false
      - YAPI_PLUGINS=[]
    depends_on:
      - yapi-mongo
    links:
      - yapi-mongo
    restart: unless-stopped
  yapi-mongo:
    image: mongo:latest
    container_name: yapi-mongo
    volumes:
      - ./data/db:/data/db
    expose:
      - 27017
    restart: unless-stopped

将 YAPI_DB_PORT 这个 env 改为 37017 然后重启了 web 和 mongo 都没有用,log 信息一直卡在 等待 MongoDB 服务可用..
服务器端口也已放开
centos 7.6
docker 20.10.12
docker-compose 1.29.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant