diff --git a/nodejs/Dockerfile b/nodejs/Dockerfile new file mode 100644 index 0000000..044bd79 --- /dev/null +++ b/nodejs/Dockerfile @@ -0,0 +1,11 @@ +FROM debian:jessie +MAINTAINER Johannes Schickling "schickling.j@gmail.com" + +ENV DEBIAN_FRONTEND noninteractive + +ADD install.sh install.sh +RUN chmod +x install.sh && ./install.sh && rm install.sh + +VOLUME ["/source"] +WORKDIR /source +CMD ["bash"] diff --git a/nodejs/README.md b/nodejs/README.md new file mode 100644 index 0000000..d6b3ec1 --- /dev/null +++ b/nodejs/README.md @@ -0,0 +1,11 @@ +# nodejs + +Minimal NodeJS + NPM image + +## Usage + +```sh +$ docker run --rm -it -v $(pwd):/source schickling/nodejs +``` + +Mount your local source folder to the container and run it inside the container. diff --git a/nodejs/install.sh b/nodejs/install.sh new file mode 100644 index 0000000..01a1eac --- /dev/null +++ b/nodejs/install.sh @@ -0,0 +1,17 @@ +#! /bin/bash + +# exit if a command fails +set -e + +# install node & npm +apt-get update && apt-get install -y nodejs npm + +# alias as node +ln -sf /usr/local/bin/nodejs /usr/local/bin/node + +# cleanup package manager +apt-get autoclean && apt-get clean +rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* + +# prepare dir +mkdir /source