Public | Automated Build

Last pushed: 2 years ago
Short Description
NodeJS runner with supervisor. Usefull for development
Full Description

nodeJS image with supervisor

Based on node:latest

Description

This image adds node-supervisor to the installation and runs the code with a restarting behavior. On startup, all of the watched folders are used for npm install, bower install and tsd install.

Run configurations

docker run -d -P -v $PWD/:/app smartive/dynamic-nginx

or with the port-definitions

docker run -d -p 9000:9000 -p 3001:3001 -v $PWD/:/app smartive/dynamic-nginx

with environment variables

docker run -d -P -e IGNORE_FILES=assets,public -e MAIN_FILE=server.js -e EXTENSIONS=js,json,coffee -v $PWD/:/app smartive/dynamic-nginx

if you want your node application not to restart on exit (e.g. for a one-time importer), you need to set NO_RESTART_ON. Possible values are explained below.

Folders

/app

Folder that contains the whole application source code to run.

Ports

9000

Base port for node application. Your application should listen for this port (e.g. expressJS)

3001

Port for BrowserSync. (cool development plugin!)

Environment variables

IGNORE_FILES

Commaseparated list of pathes that should be ignored (from the root) [e.g. assets,public ]

Default: noop

MAIN_FILE

Startup file for node

Default: app.js

EXTENSIONS

Commaseparated list of fileextensions that trigger a restart.

Default: js,json,node

WATCHING

Commaseparated list of watched folders.

Default: .

NO_RESTART_ON

Tells supervisor not to restart on different conditions. If you don't set this variable, supervisor will restart your app no matter what (on code changes, normal exit or error exit). If you code somethink like a one-time-importer, you may not want to restart everytime. You can set the following variable values:

  • error : error means, supervisor will not restart your application, if there was an error (i.e. exit code '0' will restart).
  • exit : exit means, supervisor will not restart your application, if the application exited on normal conditions nor an error. The "only" trigger supervisor will use is a change of code.

Default: unset

Docker Pull Command
Owner
smartive

Comments (0)