I was trying to get the HRM working in the docker environment today. What I forgot is how the webpacker try to resolv the webpacker server, which is not obvious in non-docker environment. Few of the points that I learned:
Webpacker host and port configurations are important in both docker-compose.yml as well as in webpacker.yml . Websocket is initialised with these values.
It is better to have a separate image that runs the bin/webpack-dev-server
Compile on demand is way too slow for development if your files are huge, or even medium sized.
public and host configuration in dev_server in webpacker.yml are two different things.
There is some issue with the docker already containing the compiled files in the output directory (typically in public/packs).
This was the final configuration that I had to get it up and running:
docker-compse.yml
dev_server section in webpacker.yml
A docker-compose up will start the web server along with the webpacker sever that will watch for change and pass it via a websocket to the frontend which will get automatically reloaded after the diff got compiled.