Sign inSign up

amble/nodemonjs7-pi

By amble

Updated over 9 years ago

nodejs7.6-container with demonized startup via nodemon.io - raspberry pi ready.

Image
1

1.3K

amble/nodemonjs7-pi repository overview

information:

node7.6 port of amble/nodemonjs-pi based on hypriot/rpi-node, incl. node v7.6 & npm v4.1.2 extended by nodemon v.1.11.0

running on any armv7 / armv71 compatible, but not tested with armv8

root@654dc35699b9:/src# node -v
v7.6.0
root@654dc35699b9:/src# npm -v
4.1.2
root@654dc35699b9:/src# nodemon -v
1.11.0
usage:
  • mkdir & pull docker-container
  • add package.json & a startup js
  • add a compose-file to your project
  • docker-compose up -d OR
  • docker run -p 8080:8080 -v $PWD:/src -d amble/nodemonjs7-pi nodemon index.js

example compose:
    version: "2"
    services:
      web:
        image: amble/nodemonjs7-pi
        container_name: nodemonjs7-app
        expose:
          - "8080"
        ports:
          - "8080:8080"
        volumes:
          - .:/src
        command:
          nodemon index.js
example package.json:
{
  "name": "my-nodejs-app",
  "version": "0.0.1",
  "description": "raspberry pi meets nodemon docker",
  "main": "server.js",
  "author": "amble",
  "dependencies": {
    "body-parser": "^1.4.3",
    "express": "^4.13.4",
    "method-override": "^2.1.3",
    "morgan": "^1.1.1"
  }
}
example index.js
var express = require('express');
var app = express(); 		
app.get('/about', function (req, res) {
        console.log('on about');
});

how to test
  • connect to http://pi.local:8080
  • fg your nodemon process
  • change index.js on your local pi filesystem
  • watch the daemon restart your nodejs app:
[nodemon] 1.11.0
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node index.js`
Running on http://localhost:8080
[nodemon] restarting due to changes...
[nodemon] starting `node index.js`
Running on http://localhost:8080/about

Licence

Copyright © 2016, 2017 mbl - Licenced under GPL-3.

Tag summary

Content type

Image

Digest

Size

171 MB

Last updated

over 9 years ago

docker pull amble/nodemonjs7-pi