Docker For Rails Developers - Chapter 7 Playing Nice With JavaScript - A Hello World React App

Rack 2.2+ has a problem with the webpack dev server name used in the book. The workaround is to change the service name webpack_dev_server to webpack-dev-server in the docker-compose.yml. You will also need to change the environment variable WEBPACKER_DEV_SERVER_HOST on the web server to match.

If your Hello World react app does not show up on your first try, use “docker-compose logs -f” and look to see if you have an error “SocketError: Failed to open TCP connection to webpack_dev_server:3035:80.” That is the key to identifying if this fix will help you.

See also:


https://blog.kotamiyake.me/tech/docker-rails-with-webpack-dev-server-and-rack/
3 Likes