Configuration for webpack dev-server in vm/docker for rebound host interfaces #9343
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is the discussion, for setting an absolute url as publicPath, when you're binding the dev server not to localhost but to any external interface (0.0.0.0) and disable host checking:
symfony/webpack-encore#96
The problem is, that when you bind the dev-server to all interfaces with
--host 0.0.0.0
this url will be written to the manifest.json, when versioning is used:`"build/main.js": "http://0.0.0.0:8080/build/main.js",
Instead the external-interface should be used:
`"build/main.js": "http://192.168.1.1:8080/build/main.js"
When in docker, you need a port mapping, to make the dev-server accessible, when browsing the site with a browser running on the host.
(please note, that it isn't possible to access docker containers with their internal ip from the host, when running docker on windows. That's why we should always recommend a host-port-mapping for the docker-container)
best regards
philipp