Public Repository

Last pushed: a year ago
Short Description
Allows developers to build NPM projects without the need to install NodeJS and NPM.
Full Description

UFirst Docker NPM builder

The NPM builder docker image allows developers to build NPM projects without the need to install NodeJS and NPM.

Usage

Run any npm command by running the image ufirtgroup/npm-builder.

  • Mount the source folder as volume to source.
  • You should define the ENV variable USER_ID to be your local user id

BrowserSync

  • If your setup runs BrowserSync you will have to maps the ports 3000 and 3001.
  • Also add a hosts entry according to your BrowserSync config so that BrowserSync can access the web server.
    ** If the application NGINX runs in another docker container, this can be a link to that container.

Example

docker run -it \
  -e "USER_ID=$(id -u)" \
  -v $PWD/frontend:/source \
  -p "3000:3000" \
  -p "3001:3001" \
  ufirstgroup/npm-builder \
  npm start

Recommended Project Setup

Set up your project as follows:

  • Make sure everybody adds ./bin permanently to its $PATH ENV variable.
  • In you project root, create a folder ./bin
  • Create an executable file called npm with the following contend (change according to your config):
docker run -it \
  -e "USER_ID=$(id -u)" \
  -v $PWD/frontend:/source \
  -p "3000:3000" \
  -p "3001:3001" \
  ufirstgroup/npm-builder \
  $(basename $0) $@
Docker Pull Command
Owner
ufirstgroup