Compiling Assets with Webpacker

We will learn to add Webpacker in our Compose.

webpack-dev-server

As part of Webpacker, Rails provides the webpack-dev-server binary. This is a small server that runs in the background, automatically compiling our webpack-managed files.

If you were developing locally, this would just be another command you would issue from your terminal. However, the Docker way is to run this as a separate service in its own container.

Modification of Compose

Let’s add a new service for it to our docker-compose.yml file:

Get hands-on with 1400+ tech skills courses.