Dockerコンテナ node実行環境 web向け

Dockerfileを用意

#--------------------------------------------------------------------------
# image setup
#--------------------------------------------------------------------------
FROM node:latest

#--------------------------------------------------------------------------
# install grunt-cli
#--------------------------------------------------------------------------
RUN npm install -g grunt-cli

#--------------------------------------------------------------------------
# install sass
#--------------------------------------------------------------------------
RUN npm install -g sass

#--------------------------------------------------------------------------
# set the working directory
#--------------------------------------------------------------------------
WORKDIR /var/www

コンテナイメージをビルド

docker build -t mynode .

bashで起動

docker run -it --rm -v `pwd`:/var/www mynode bash