It is used to speed up setup when developping a project using React with npm.It prepares a container with latest versions of:

node

npm

WebPack

React

EsLint

a good deal of node modules pre-installed.

Environments

It bootstraps an application with three environments:

dev, an environment to develop on a local machine, hot reload components, etc.

dist, an environment releasing only the code that is used packaged for distribution.

test, an environment to run automated tests.

Do not use this image for production, you should compile your React anyway andonly push the result of the dist folder when running npm run dist.

Dev

The default environment is dev and this image provides a server (started bythe default command npm start) that serves from port 80. As with all Dockercontainers we suggest you do some port forwarding when creating an image(docker run -p 3000:80).

Setup and configuration

Use it as a base and mount or copy your actual application to /usr/app.

The webpack configurations are in /usr/app/cfg/ (base.js, dev.js, …). Tomodify those configs you need to overwrite them by copying a new file on top ofit.

The actual source of the app should be mounted in /usr/app/src, morespecifically the webpack entrypoint for the app is taken by default from/usr/app/src/entry.js or /usr/app/src/entry.jsx.