0

I have set up Webpack Dev Server which works fine when I start it (yarn run webpack-dev-server): I can visit http://localhost:3000 and see my app.

However, I've also set up Docker compose to run this server, among others, in a Docker container. When I start the Docker container, I can call wget http://localhost:3000 in the container just fine and receive a successful response. However, when I visit http://localhost:3000 in my browser, I see "The connection was reset".

My docker-compose.yml does include the following line:

ports:
  - "3000:3000"

Is there anything else I forgot to do that is needed to successfully access the server from outside the Docker container?

Vincent
  • 4,876
  • 3
  • 44
  • 55
  • The Webpack dev server by default binds to `localhost`, which in Docker land means it’s inaccessible outside the current container. In addition to the command-line option in the linked answer, the Webpack documentation also has a permanent configuration setting. – David Maze Feb 25 '19 at 15:14
  • Huh, thanks for that David - so much for my searching-fu. That was indeed the issue. – Vincent Feb 25 '19 at 15:15

0 Answers0