Public Repository

Last pushed: 10 months ago
Short Description
Docker image to run applications in production mode using nodejs.
Full Description


What is included?

This image is based on official node.js docker image (Debian stable, Wheezy).

Current version includes:

  • node 0.12
  • general tools: wget, vim
  • node production tools: forever

The default docker user is "prod".

The default directory is /app/dist

How to use

Use the image to run your application with node

Mount your application sources as a volume (using -v option) and run your build command (e.g. gulp build).

docker run -v /home/me/dev/my-app/dist:/app/dist -t toubiweb/docker-node-runner node app.js

You can override the default directory using -w option:

docker run -v /home/me/dev/my-app/dist:/app/build -w /app/build -t toubiweb/docker-node-runner node app.js

Use with forever

docker run -v /home/me/dev/my-app/dist:/app/dist -t toubiweb/docker-node-runner forever node app.js

Extend image

Extends the image to run your application:

# Pull base image.
FROM toubiweb/docker-node-runner:0.12

MAINTAINER Nicolas Toublanc <>

USER root

RUN chown -R prod /app/dist

USER prod

# install via npm (production dependencies)
ADD package.json /app/dist/
RUN npm install --loglevel verbose

# add application
ADD . /app/dist

# define default command.
CMD forever -l /app/logs/server.log -o /app/logs/out.log -e /app/logs/err.log  /app/dist/server/app.js

# Expose ports.

Optional: build docker image from sources

Get sources:

git clone

Build container

cd docker-node-runner
docker build -t="toubiweb/docker-node-runner" .
Docker Pull Command

Comments (0)