将Docker容器中的webpack-dev-server与主机连接起来 [英] Connecting webpack-dev-server inside a Docker container from the host
本文介绍了将Docker容器中的webpack-dev-server与主机连接起来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
解决方案
此问题不是docker问题。
将--host = 0.0.0.0添加到您的webpack命令。
您需要连接到您的页面像这样:
http:/ /host:port/webpack-dev-server/index.html
查看 iframe模式
I'm running a webpack-dev-server application inside a Docker container (node:4.2.1). If I try to connect to the server port from within the container - it works fine. However, trying to connect it from the host computer results in reset connection (the port is published, of course). How can I fix it?
解决方案
This issue is not a docker problem.
Add --host=0.0.0.0 to your webpack command.
You need to connect to your page like this:
http://host:port/webpack-dev-server/index.html
Look to the iframe mode
这篇关于将Docker容器中的webpack-dev-server与主机连接起来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文