Coder Social home page Coder Social logo

Comments (11)

lxerxa avatar lxerxa commented on July 20, 2024

从哪里迁到哪里?docker安装的话,db数据文件都在 data/db 下。

from actionview.

jxwuqingyan avatar jxwuqingyan commented on July 20, 2024

就是从一台服务器迁移到另一台服务器,只要拷贝data/db下的文件 然后重新运行 docker-compose就行吗?

from actionview.

lxerxa avatar lxerxa commented on July 20, 2024

是这样的。

from actionview.

jxwuqingyan avatar jxwuqingyan commented on July 20, 2024

是这样的。

那如果我想在现有容器运行的状态下把db的端口映射出来是不是修改docker-compose.yml
expose:
- 27017
改为
ports:
- 自定义端口:27017

然后docker-compose build 再docker-compose up -d这样呢?还是有其他操作

from actionview.

lxerxa avatar lxerxa commented on July 20, 2024

db容器27017已经expose了吧,docker-compose build可能不行,没写那个命令,可以单独build db的dockerfile.

from actionview.

jxwuqingyan avatar jxwuqingyan commented on July 20, 2024

db容器27017已经expose了吧,docker-compose build可能不行,没写那个命令,可以单独build db的dockerfile.

嗯 我是想把db容器的27017映射到宿主机的一个端口,然后外部通过宿主机IP 去连DB

from actionview.

lxerxa avatar lxerxa commented on July 20, 2024

了解,可以按照你的方式修改docker-compose.yml,然后再docker-compose up,不需要docker-compose build.

from actionview.

jxwuqingyan avatar jxwuqingyan commented on July 20, 2024

了解,可以按照你的方式修改docker-compose.yml,然后再docker-compose up,不需要docker-compose build.

好的 非常感谢~~

from actionview.

jxwuqingyan avatar jxwuqingyan commented on July 20, 2024

不好意思 再咨询下 默认的mongo数据库名 用户名 密码是什么

from actionview.

lxerxa avatar lxerxa commented on July 20, 2024

USER=${MONGODB_USERNAME:-actionview}
PASS=${MONGODB_PASSWORD:-secret}
DB=${MONGODB_DBNAME:-actionviewdb}

from actionview.

jxwuqingyan avatar jxwuqingyan commented on July 20, 2024

USER=${MONGODB_USERNAME:-actionview}
PASS=${MONGODB_PASSWORD:-secret}
DB=${MONGODB_DBNAME:-actionviewdb}

OK

from actionview.

Related Issues (20)

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.