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

前端 未结 2 1620
抹茶落季
抹茶落季 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条回答
  •  旧时难觅i
    2020-12-14 10:47

    You need to make sure:

    • you docker container has mapped the EXPOSE'd port to a host port

      docker run -p x:y 
      
    • your VM (if you are using docker machine with a VM) has forwarded that mapped port to the actual host (the host of the VM).
      See "How to access tomcat running in docker container from browser?"

提交回复
热议问题