This repository has been archived by the owner. It is now read-only.
NodeJS Docker Container
Makefile
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Dockerfile
Makefile
README.md

README.md

A docker container for nodejs apps

This is simply a Dockerfile for building a simple docker container that runs nodejs apps.

Current Node.js version: 0.10.34

The container does not contain anything else.

Usage

By default, everything runs under an unprivileged user called default, with the working directory set to /home/default. This user has passwordless sudo access.

If you just want a bash prompt:

docker run -t -i quay.io/flippa/nodejs /bin/bash

If you want to work in the REPL temporarily:

docker run -t -i quay.io/flippa/nodejs node

If you want to load and run an app with npm:

docker run -d \
  -v ~/projects/foo:/apps/foo \
  -w /apps/foo \
  -p 3000:3000 \
  quay.io/flippa/nodejs \
  npm start

The above command mounts your copy of ~/projects/foo to /apps/foo in the container, then sets the working directory to /apps/foo and performs npm start to start the app running. It also exposes the container's port 3000 to the host as port 3000.