This image contains Node.js v5.6 and NPM v3.7. It is based on Alpine linux, which, despite being a very lightweight distribution, provides
apk package manager, allowing easy installation of many pre-built packages.
Basic image. Contains Node and NPM.
Extended version of the image with added
ONBUILD triggers (similar to and inspired by google/nodejs-runtime image). These triggers execute on each build of a derived image, and perform two tasks:
- Copy everything from the directory containing
/appdirectory inside the container, but skip
node_modulesdirectory and all files/dirs listed in the
- Install NPM-managed dependencies; reuse Docker image cache if dependencies have not changed since previous build.
This allows Dockerfiles of derived images to contain less boilerplate instructions:
FROM ficusio/node-alpine:5-onbuild EXPOSE 8080 # This will be performed automatically: # WORKDIR /app # COPY . /app # npm install --production # CMD ["node", "index.js"]