Connecting webpack-dev-server inside a Docker container from the host

前端 未结 2 1618
抹茶落季
抹茶落季 2020-12-14 09:54

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. Howev

2条回答
  •  星月不相逢
    2020-12-14 10:41

    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

提交回复
热议问题