question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dev-server inside docker?

See original GitHub issue

Hi,

I’m trying to get encore dev-server to work inside a docker container.

I noticed at first that it listens only on the container’s loopback interface (‘localhost’), which was OK, because I could use --host 0.0.0.0 to get it to listen on the proper network interface…

But when I do this the manifest.json ends up using http://0.0.0.0:8080/.... as it’s url prefix, and this stops the assets from loading.

I tried the --public ... flag to set a hostname for the public URL, but that doesn’t seem to affect manifest generation.

How can I do this?

Thanks.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:4
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

5reactions
Jeyffreycommented, Apr 25, 2019

My project is based on a Docker and my container listen to the port 8088. Symfony webpack-dev-server works by default on the port 8080. In the docker-compose file, i just had to open the 8080 port in both sides :

services:
    ...
    my_container:
        ...
        ports:
            ...
            - "8080:8080".

And my Yarn script is now (according to this comment) : "dev-server": "encore dev-server --host 0.0.0.0 --disable-host-check"

It just works now ! 🎉

1reaction
samjarrettcommented, Jun 27, 2017

Hey @davidmpaz, actually it’s an issue with how encore bundles a few webpack configuration items into one setting, which in a docker (or any remote dev style environment) you would hit an issue with.

To recap the problem:

  1. webpack dev server defaults to binding only on local loopback
  2. Official --help on encore dev-server says to use --host= to change the bind
  3. This also then changes the host name configured in webpack manifest plugin

Encore doesn’t provide a way of altering the config manually for the manifest plugin. If I was using standard webpack config I would easily be able to override that.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running WebpackDevServer in Docker - DEV Community ‍ ‍
Sometimes we want to run webpack-dev-server in a Docker container. The reason might be like following. Want to use a specific Node.js version ......
Read more >
Configure Webpack to work inside a container - Okteto
How to adjust your Webpack configuration to work inside a Docker container. ... the container webpack-dev-server must be configured to use 0.0.0.0 as...
Read more >
Cannot run webpack-dev-server inside docker - Stack Overflow
I just want to add something to Raphayol answer if you couldn't enable hot-reloading of webpack-dev-server inside container.
Read more >
Configuring webpack dev server watch inside docker ...
When running webpack dev server from inside of docker container dev server says that it watching files, but don't react on changes in...
Read more >
Connection reset with webpack-dev-server inside Docker
All of that was fine though, the issue is with how webpack is being configured, specifically the host property inside of the devServer...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found