Docker HTTP-requests between containers

后端 未结 1 376
你的背包
你的背包 2021-02-02 08:07

I\'m at the first stage in learning how to use Docker so I\'m trying basic things. I\'ve created two Node Express services that need to exchange data via HTTP-requests.

相关标签:
1条回答
  • 2021-02-02 08:19

    See the document. The port 10010 is a host port but not container port. You should use 9000 when you access service2 container directly.

    So just change "http://service2:10010/api/" to "http://service2:9000/api/" and it will work.

    0 讨论(0)
提交回复
热议问题