Cannot run webpack-dev-server inside docker

前端 未结 3 1634
遥遥无期
遥遥无期 2021-02-01 20:46

I have created a docker image which serves a simple react app using webpack from inside the container, but I get nothing in the browser.

Here are my config files

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-02-01 21:21

    When using webpack-dev-server with Encore and exposing it through Docker, you we'll need to use --host 0.0.0.0 and --public localhost:8080 so files are served even on browsers not navigating to 0.0.0.0 adresses.

    Here is what I used :

    webpack-dev-server --hot --host=0.0.0.0 --public=localhost:8080
    

提交回复
热议问题