February 2019
Intermediate to advanced
240 pages
5h 25m
English
Rails has included a way to build rich JavaScript front ends into your apps since version 5.1, using a gem called webpacker. Webpacker has a modular architecture, allowing you to integrate different front-end technologies, be it React, Ember, Vue.js, or even Elm.
Using React as an example, let’s see how we’d configure Webpacker in our Dockerized app.
First things first. Webpacker requires Yarn and a current version of Node. This requires an update to our Docker image:
| 1: | FROM ruby:2.6 |
| - | LABEL maintainer="rob@DockerForRailsDevelopers.com" |
| - | |
| - | # Allow apt to work with https-based sources |
| 5: | RUN apt-get update -yqq && apt-get install -yqq --no-install-recommends \ |
| - | apt-transport-https |
| |