Create a Dockerfile:
FROM node:latest MAINTAINER Zhentian Wan ENV NODE_ENV=production ENV PORT=3000 COPY . /var/www WORKDIR /var/www RUN npm install EXPOSE $PORT ENTRYPOINT ["npm", "start"]
Build Dockerfile:
docker build -t zhentian/node .
Run image:
docker run -d -p 8080:3000 zhentian/node