cant connect node docker container to mongo docker container










0















I get this error:



Server running...
MongoNetworkError: failed to connect to server [mongo:27017] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN mongo mongo:27017]
at Pool.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/topologies/server.js:562:11)
at Pool.emit (events.js:182:13)
at Connection.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/pool.js:316:12)
at Object.onceWrapper (events.js:273:13)
at Connection.emit (events.js:182:13)
at Socket.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/connection.js:245:50)
at Object.onceWrapper (events.js:273:13)
at Socket.emit (events.js:182:13)
at emitErrorNT (internal/streams/destroy.js:82:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
at process._tickCallback (internal/process/next_tick.js:63:19)
name: 'MongoNetworkError',
message:
'failed to connect to server [mongo:27017] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN mongo mongo:27017]',
errorLabels: [ 'TransientTransactionError' ],
[Symbol(mongoErrorContextSymbol)]:


this is my docker-compose.yml



version: '3'
services:
app:
container_name: docker-node-mongo
restart: always
build: .
ports:
- '3001:3000'


this is how i tried to connet from node script:



mongoose
.connect(
'mongodb://127.0.0.1:27017/test2',
useNewUrlParser: true
)
.then(() => console.log('MongoDB Connected'))
.catch(err => console.log("errorErrorError"));


this is the output of docker container ls -a



6f14a98e2d51 dockernodemongo_app "npm start" 11 minutes ago Up 11 minutes 0.0.0.0:3001->3000/tcp docker-node-mongo
f3fb55dad886 mongo "docker-entrypoint.s…" 24 minutes ago Up 24 minutes 127.0.0.1:27017->27017/tcp mongo


this is how i run mongo from a another docker-compose.yml file:



 mongo:
restart: always
image: mongo
container_name: mongo
network_mode: "bridge"
# expose:
# - 27017
volumes:
- ./mongo_data:/data/db
ports:
- "127.0.0.1:27017:27017"









share|improve this question


























    0















    I get this error:



    Server running...
    MongoNetworkError: failed to connect to server [mongo:27017] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN mongo mongo:27017]
    at Pool.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/topologies/server.js:562:11)
    at Pool.emit (events.js:182:13)
    at Connection.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/pool.js:316:12)
    at Object.onceWrapper (events.js:273:13)
    at Connection.emit (events.js:182:13)
    at Socket.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/connection.js:245:50)
    at Object.onceWrapper (events.js:273:13)
    at Socket.emit (events.js:182:13)
    at emitErrorNT (internal/streams/destroy.js:82:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
    at process._tickCallback (internal/process/next_tick.js:63:19)
    name: 'MongoNetworkError',
    message:
    'failed to connect to server [mongo:27017] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN mongo mongo:27017]',
    errorLabels: [ 'TransientTransactionError' ],
    [Symbol(mongoErrorContextSymbol)]:


    this is my docker-compose.yml



    version: '3'
    services:
    app:
    container_name: docker-node-mongo
    restart: always
    build: .
    ports:
    - '3001:3000'


    this is how i tried to connet from node script:



    mongoose
    .connect(
    'mongodb://127.0.0.1:27017/test2',
    useNewUrlParser: true
    )
    .then(() => console.log('MongoDB Connected'))
    .catch(err => console.log("errorErrorError"));


    this is the output of docker container ls -a



    6f14a98e2d51 dockernodemongo_app "npm start" 11 minutes ago Up 11 minutes 0.0.0.0:3001->3000/tcp docker-node-mongo
    f3fb55dad886 mongo "docker-entrypoint.s…" 24 minutes ago Up 24 minutes 127.0.0.1:27017->27017/tcp mongo


    this is how i run mongo from a another docker-compose.yml file:



     mongo:
    restart: always
    image: mongo
    container_name: mongo
    network_mode: "bridge"
    # expose:
    # - 27017
    volumes:
    - ./mongo_data:/data/db
    ports:
    - "127.0.0.1:27017:27017"









    share|improve this question
























      0












      0








      0








      I get this error:



      Server running...
      MongoNetworkError: failed to connect to server [mongo:27017] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN mongo mongo:27017]
      at Pool.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/topologies/server.js:562:11)
      at Pool.emit (events.js:182:13)
      at Connection.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/pool.js:316:12)
      at Object.onceWrapper (events.js:273:13)
      at Connection.emit (events.js:182:13)
      at Socket.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/connection.js:245:50)
      at Object.onceWrapper (events.js:273:13)
      at Socket.emit (events.js:182:13)
      at emitErrorNT (internal/streams/destroy.js:82:8)
      at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
      at process._tickCallback (internal/process/next_tick.js:63:19)
      name: 'MongoNetworkError',
      message:
      'failed to connect to server [mongo:27017] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN mongo mongo:27017]',
      errorLabels: [ 'TransientTransactionError' ],
      [Symbol(mongoErrorContextSymbol)]:


      this is my docker-compose.yml



      version: '3'
      services:
      app:
      container_name: docker-node-mongo
      restart: always
      build: .
      ports:
      - '3001:3000'


      this is how i tried to connet from node script:



      mongoose
      .connect(
      'mongodb://127.0.0.1:27017/test2',
      useNewUrlParser: true
      )
      .then(() => console.log('MongoDB Connected'))
      .catch(err => console.log("errorErrorError"));


      this is the output of docker container ls -a



      6f14a98e2d51 dockernodemongo_app "npm start" 11 minutes ago Up 11 minutes 0.0.0.0:3001->3000/tcp docker-node-mongo
      f3fb55dad886 mongo "docker-entrypoint.s…" 24 minutes ago Up 24 minutes 127.0.0.1:27017->27017/tcp mongo


      this is how i run mongo from a another docker-compose.yml file:



       mongo:
      restart: always
      image: mongo
      container_name: mongo
      network_mode: "bridge"
      # expose:
      # - 27017
      volumes:
      - ./mongo_data:/data/db
      ports:
      - "127.0.0.1:27017:27017"









      share|improve this question














      I get this error:



      Server running...
      MongoNetworkError: failed to connect to server [mongo:27017] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN mongo mongo:27017]
      at Pool.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/topologies/server.js:562:11)
      at Pool.emit (events.js:182:13)
      at Connection.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/pool.js:316:12)
      at Object.onceWrapper (events.js:273:13)
      at Connection.emit (events.js:182:13)
      at Socket.<anonymous> (/usr/src/app/node_modules/mongodb-core/lib/connection/connection.js:245:50)
      at Object.onceWrapper (events.js:273:13)
      at Socket.emit (events.js:182:13)
      at emitErrorNT (internal/streams/destroy.js:82:8)
      at emitErrorAndCloseNT (internal/streams/destroy.js:50:3)
      at process._tickCallback (internal/process/next_tick.js:63:19)
      name: 'MongoNetworkError',
      message:
      'failed to connect to server [mongo:27017] on first connect [MongoNetworkError: getaddrinfo EAI_AGAIN mongo mongo:27017]',
      errorLabels: [ 'TransientTransactionError' ],
      [Symbol(mongoErrorContextSymbol)]:


      this is my docker-compose.yml



      version: '3'
      services:
      app:
      container_name: docker-node-mongo
      restart: always
      build: .
      ports:
      - '3001:3000'


      this is how i tried to connet from node script:



      mongoose
      .connect(
      'mongodb://127.0.0.1:27017/test2',
      useNewUrlParser: true
      )
      .then(() => console.log('MongoDB Connected'))
      .catch(err => console.log("errorErrorError"));


      this is the output of docker container ls -a



      6f14a98e2d51 dockernodemongo_app "npm start" 11 minutes ago Up 11 minutes 0.0.0.0:3001->3000/tcp docker-node-mongo
      f3fb55dad886 mongo "docker-entrypoint.s…" 24 minutes ago Up 24 minutes 127.0.0.1:27017->27017/tcp mongo


      this is how i run mongo from a another docker-compose.yml file:



       mongo:
      restart: always
      image: mongo
      container_name: mongo
      network_mode: "bridge"
      # expose:
      # - 27017
      volumes:
      - ./mongo_data:/data/db
      ports:
      - "127.0.0.1:27017:27017"






      javascript node.js mongodb docker networking






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 13 '18 at 18:16









      KT WorksKT Works

      15116




      15116






















          1 Answer
          1






          active

          oldest

          votes


















          1














          You cannot connect your application to mongo that way. 127.0.0.1 refers to the localhost of the container, not the host. You have two options:



          • Create a network and add both containers to it. Then use mongodb://mongo:27017/test2 to reach the mongo container. Docker will use the service name as a host so you can reach it by that name.


          • Bind mongo to 0.0.0.0 (omit the 127.0.0.1 from the port declaration) and connect to the database using the bridge ip address.


          Consider the first option, because the second one will expose your mongo database to the internet if you don't have a firewall in place.



          For example:



          version: '3.5'
          services:
          app:
          container_name: docker-node-mongo
          restart: always
          build: .
          ports:
          - '3001:3000'
          networks:
          - mongo

          networks:
          mongo:
          external: true


          Then on your mongo compose file:



          version: '3.5'
          services:
          mongo:
          restart: always
          image: mongo
          container_name: mongo
          expose:
          - 27017
          volumes:
          - ./mongo_data:/data/db
          ports:
          - "127.0.0.1:27017:27017"
          networks:
          - mongo

          networks:
          mongo:
          name: mongo


          Then on your code:



          mongoose
          .connect(
          'mongodb://mongo:27017/test2',
          useNewUrlParser: true
          )
          .then(() => console.log('MongoDB Connected'))
          .catch(err => console.log("errorErrorError"));


          edit: updated network names






          share|improve this answer

























          • problem is that i have sharelatex running which needs mongo and i want to run node which needs mongo, too. So you will recommend to run 2 instances of mongo?

            – KT Works
            Nov 13 '18 at 19:57












          • @KTWorks, why is is a problem? you can both publish a port on the host and create a network so other containers can connect to the service.

            – codestation
            Nov 13 '18 at 20:02











          • ok. you said this is security problem to publish the port on the host? What do you mean with "you can both publish a port on the host" ? 2 mongo instances?

            – KT Works
            Nov 13 '18 at 20:03












          • I mean that using 27017:27017 will bind to 0.0.0.0 on the host and anybody can connect to mongo from the internet if you don't have a configured firewall, this is why i don't recommend going that route. I will update my andwer with a more complete example.

            – codestation
            Nov 13 '18 at 20:12







          • 1





            what do you mean by hand? Own docker compose file?

            – KT Works
            Nov 13 '18 at 21:47










          Your Answer






          StackExchange.ifUsing("editor", function ()
          StackExchange.using("externalEditor", function ()
          StackExchange.using("snippets", function ()
          StackExchange.snippets.init();
          );
          );
          , "code-snippets");

          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "1"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader:
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          ,
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













          draft saved

          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287202%2fcant-connect-node-docker-container-to-mongo-docker-container%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          1














          You cannot connect your application to mongo that way. 127.0.0.1 refers to the localhost of the container, not the host. You have two options:



          • Create a network and add both containers to it. Then use mongodb://mongo:27017/test2 to reach the mongo container. Docker will use the service name as a host so you can reach it by that name.


          • Bind mongo to 0.0.0.0 (omit the 127.0.0.1 from the port declaration) and connect to the database using the bridge ip address.


          Consider the first option, because the second one will expose your mongo database to the internet if you don't have a firewall in place.



          For example:



          version: '3.5'
          services:
          app:
          container_name: docker-node-mongo
          restart: always
          build: .
          ports:
          - '3001:3000'
          networks:
          - mongo

          networks:
          mongo:
          external: true


          Then on your mongo compose file:



          version: '3.5'
          services:
          mongo:
          restart: always
          image: mongo
          container_name: mongo
          expose:
          - 27017
          volumes:
          - ./mongo_data:/data/db
          ports:
          - "127.0.0.1:27017:27017"
          networks:
          - mongo

          networks:
          mongo:
          name: mongo


          Then on your code:



          mongoose
          .connect(
          'mongodb://mongo:27017/test2',
          useNewUrlParser: true
          )
          .then(() => console.log('MongoDB Connected'))
          .catch(err => console.log("errorErrorError"));


          edit: updated network names






          share|improve this answer

























          • problem is that i have sharelatex running which needs mongo and i want to run node which needs mongo, too. So you will recommend to run 2 instances of mongo?

            – KT Works
            Nov 13 '18 at 19:57












          • @KTWorks, why is is a problem? you can both publish a port on the host and create a network so other containers can connect to the service.

            – codestation
            Nov 13 '18 at 20:02











          • ok. you said this is security problem to publish the port on the host? What do you mean with "you can both publish a port on the host" ? 2 mongo instances?

            – KT Works
            Nov 13 '18 at 20:03












          • I mean that using 27017:27017 will bind to 0.0.0.0 on the host and anybody can connect to mongo from the internet if you don't have a configured firewall, this is why i don't recommend going that route. I will update my andwer with a more complete example.

            – codestation
            Nov 13 '18 at 20:12







          • 1





            what do you mean by hand? Own docker compose file?

            – KT Works
            Nov 13 '18 at 21:47















          1














          You cannot connect your application to mongo that way. 127.0.0.1 refers to the localhost of the container, not the host. You have two options:



          • Create a network and add both containers to it. Then use mongodb://mongo:27017/test2 to reach the mongo container. Docker will use the service name as a host so you can reach it by that name.


          • Bind mongo to 0.0.0.0 (omit the 127.0.0.1 from the port declaration) and connect to the database using the bridge ip address.


          Consider the first option, because the second one will expose your mongo database to the internet if you don't have a firewall in place.



          For example:



          version: '3.5'
          services:
          app:
          container_name: docker-node-mongo
          restart: always
          build: .
          ports:
          - '3001:3000'
          networks:
          - mongo

          networks:
          mongo:
          external: true


          Then on your mongo compose file:



          version: '3.5'
          services:
          mongo:
          restart: always
          image: mongo
          container_name: mongo
          expose:
          - 27017
          volumes:
          - ./mongo_data:/data/db
          ports:
          - "127.0.0.1:27017:27017"
          networks:
          - mongo

          networks:
          mongo:
          name: mongo


          Then on your code:



          mongoose
          .connect(
          'mongodb://mongo:27017/test2',
          useNewUrlParser: true
          )
          .then(() => console.log('MongoDB Connected'))
          .catch(err => console.log("errorErrorError"));


          edit: updated network names






          share|improve this answer

























          • problem is that i have sharelatex running which needs mongo and i want to run node which needs mongo, too. So you will recommend to run 2 instances of mongo?

            – KT Works
            Nov 13 '18 at 19:57












          • @KTWorks, why is is a problem? you can both publish a port on the host and create a network so other containers can connect to the service.

            – codestation
            Nov 13 '18 at 20:02











          • ok. you said this is security problem to publish the port on the host? What do you mean with "you can both publish a port on the host" ? 2 mongo instances?

            – KT Works
            Nov 13 '18 at 20:03












          • I mean that using 27017:27017 will bind to 0.0.0.0 on the host and anybody can connect to mongo from the internet if you don't have a configured firewall, this is why i don't recommend going that route. I will update my andwer with a more complete example.

            – codestation
            Nov 13 '18 at 20:12







          • 1





            what do you mean by hand? Own docker compose file?

            – KT Works
            Nov 13 '18 at 21:47













          1












          1








          1







          You cannot connect your application to mongo that way. 127.0.0.1 refers to the localhost of the container, not the host. You have two options:



          • Create a network and add both containers to it. Then use mongodb://mongo:27017/test2 to reach the mongo container. Docker will use the service name as a host so you can reach it by that name.


          • Bind mongo to 0.0.0.0 (omit the 127.0.0.1 from the port declaration) and connect to the database using the bridge ip address.


          Consider the first option, because the second one will expose your mongo database to the internet if you don't have a firewall in place.



          For example:



          version: '3.5'
          services:
          app:
          container_name: docker-node-mongo
          restart: always
          build: .
          ports:
          - '3001:3000'
          networks:
          - mongo

          networks:
          mongo:
          external: true


          Then on your mongo compose file:



          version: '3.5'
          services:
          mongo:
          restart: always
          image: mongo
          container_name: mongo
          expose:
          - 27017
          volumes:
          - ./mongo_data:/data/db
          ports:
          - "127.0.0.1:27017:27017"
          networks:
          - mongo

          networks:
          mongo:
          name: mongo


          Then on your code:



          mongoose
          .connect(
          'mongodb://mongo:27017/test2',
          useNewUrlParser: true
          )
          .then(() => console.log('MongoDB Connected'))
          .catch(err => console.log("errorErrorError"));


          edit: updated network names






          share|improve this answer















          You cannot connect your application to mongo that way. 127.0.0.1 refers to the localhost of the container, not the host. You have two options:



          • Create a network and add both containers to it. Then use mongodb://mongo:27017/test2 to reach the mongo container. Docker will use the service name as a host so you can reach it by that name.


          • Bind mongo to 0.0.0.0 (omit the 127.0.0.1 from the port declaration) and connect to the database using the bridge ip address.


          Consider the first option, because the second one will expose your mongo database to the internet if you don't have a firewall in place.



          For example:



          version: '3.5'
          services:
          app:
          container_name: docker-node-mongo
          restart: always
          build: .
          ports:
          - '3001:3000'
          networks:
          - mongo

          networks:
          mongo:
          external: true


          Then on your mongo compose file:



          version: '3.5'
          services:
          mongo:
          restart: always
          image: mongo
          container_name: mongo
          expose:
          - 27017
          volumes:
          - ./mongo_data:/data/db
          ports:
          - "127.0.0.1:27017:27017"
          networks:
          - mongo

          networks:
          mongo:
          name: mongo


          Then on your code:



          mongoose
          .connect(
          'mongodb://mongo:27017/test2',
          useNewUrlParser: true
          )
          .then(() => console.log('MongoDB Connected'))
          .catch(err => console.log("errorErrorError"));


          edit: updated network names







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 13 '18 at 22:24

























          answered Nov 13 '18 at 19:52









          codestationcodestation

          8241915




          8241915












          • problem is that i have sharelatex running which needs mongo and i want to run node which needs mongo, too. So you will recommend to run 2 instances of mongo?

            – KT Works
            Nov 13 '18 at 19:57












          • @KTWorks, why is is a problem? you can both publish a port on the host and create a network so other containers can connect to the service.

            – codestation
            Nov 13 '18 at 20:02











          • ok. you said this is security problem to publish the port on the host? What do you mean with "you can both publish a port on the host" ? 2 mongo instances?

            – KT Works
            Nov 13 '18 at 20:03












          • I mean that using 27017:27017 will bind to 0.0.0.0 on the host and anybody can connect to mongo from the internet if you don't have a configured firewall, this is why i don't recommend going that route. I will update my andwer with a more complete example.

            – codestation
            Nov 13 '18 at 20:12







          • 1





            what do you mean by hand? Own docker compose file?

            – KT Works
            Nov 13 '18 at 21:47

















          • problem is that i have sharelatex running which needs mongo and i want to run node which needs mongo, too. So you will recommend to run 2 instances of mongo?

            – KT Works
            Nov 13 '18 at 19:57












          • @KTWorks, why is is a problem? you can both publish a port on the host and create a network so other containers can connect to the service.

            – codestation
            Nov 13 '18 at 20:02











          • ok. you said this is security problem to publish the port on the host? What do you mean with "you can both publish a port on the host" ? 2 mongo instances?

            – KT Works
            Nov 13 '18 at 20:03












          • I mean that using 27017:27017 will bind to 0.0.0.0 on the host and anybody can connect to mongo from the internet if you don't have a configured firewall, this is why i don't recommend going that route. I will update my andwer with a more complete example.

            – codestation
            Nov 13 '18 at 20:12







          • 1





            what do you mean by hand? Own docker compose file?

            – KT Works
            Nov 13 '18 at 21:47
















          problem is that i have sharelatex running which needs mongo and i want to run node which needs mongo, too. So you will recommend to run 2 instances of mongo?

          – KT Works
          Nov 13 '18 at 19:57






          problem is that i have sharelatex running which needs mongo and i want to run node which needs mongo, too. So you will recommend to run 2 instances of mongo?

          – KT Works
          Nov 13 '18 at 19:57














          @KTWorks, why is is a problem? you can both publish a port on the host and create a network so other containers can connect to the service.

          – codestation
          Nov 13 '18 at 20:02





          @KTWorks, why is is a problem? you can both publish a port on the host and create a network so other containers can connect to the service.

          – codestation
          Nov 13 '18 at 20:02













          ok. you said this is security problem to publish the port on the host? What do you mean with "you can both publish a port on the host" ? 2 mongo instances?

          – KT Works
          Nov 13 '18 at 20:03






          ok. you said this is security problem to publish the port on the host? What do you mean with "you can both publish a port on the host" ? 2 mongo instances?

          – KT Works
          Nov 13 '18 at 20:03














          I mean that using 27017:27017 will bind to 0.0.0.0 on the host and anybody can connect to mongo from the internet if you don't have a configured firewall, this is why i don't recommend going that route. I will update my andwer with a more complete example.

          – codestation
          Nov 13 '18 at 20:12






          I mean that using 27017:27017 will bind to 0.0.0.0 on the host and anybody can connect to mongo from the internet if you don't have a configured firewall, this is why i don't recommend going that route. I will update my andwer with a more complete example.

          – codestation
          Nov 13 '18 at 20:12





          1




          1





          what do you mean by hand? Own docker compose file?

          – KT Works
          Nov 13 '18 at 21:47





          what do you mean by hand? Own docker compose file?

          – KT Works
          Nov 13 '18 at 21:47

















          draft saved

          draft discarded
















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid


          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.

          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287202%2fcant-connect-node-docker-container-to-mongo-docker-container%23new-answer', 'question_page');

          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          這個網誌中的熱門文章

          Barbados

          How to read a connectionString WITH PROVIDER in .NET Core?

          Node.js Script on GitHub Pages or Amazon S3