1
0
mirror of /repos/node-red-pi2.git synced 2025-12-30 07:31:34 +01:00

initial commit

This commit is contained in:
Aiko Mastboom 2015-05-09 07:43:05 +02:00
commit 8aebd586d0
6 changed files with 111 additions and 0 deletions

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
# Use phusion/baseimage as base image. To make your builds reproducible, make
# sure you lock down to a specific version, not to `latest`!
# See https://github.com/phusion/baseimage-docker/blob/master/Changelog.md for
# a list of version numbers.
FROM phusion/baseimage-pi:0.9.16
# Use baseimage-docker's init system.
CMD ["/sbin/my_init"]
# ...put your own build instructions here...
COPY . /data
RUN /data/bootstrap
RUN su - red /data/bootstrap-red
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

22
Makefile Normal file
View File

@ -0,0 +1,22 @@
.PHONY: all build push test version
DOCKER_IMAGE_VERSION=0.10.6
DOCKER_IMAGE_NAME=aiko/node-red-pi
DOCKER_IMAGE_TAGNAME=$(DOCKER_IMAGE_NAME):$(DOCKER_IMAGE_VERSION)
all: build
build:
docker build -t $(DOCKER_IMAGE_TAGNAME) .
docker tag -f $(DOCKER_IMAGE_TAGNAME) $(DOCKER_IMAGE_NAME):latest
push:
docker push $(DOCKER_IMAGE_NAME)
test:
docker run --rm $(DOCKER_IMAGE_TAGNAME) /bin/echo "Success."
version:
docker run --rm $(DOCKER_IMAGE_TAGNAME) node --version
docker run --rm $(DOCKER_IMAGE_TAGNAME) npm --version

21
bootstrap Executable file
View File

@ -0,0 +1,21 @@
apt-get update
echo "Europe/Amsterdam" | tee /etc/timezone ; dpkg-reconfigure --frontend noninteractive tzdata
apt-get install -y build-essential sudo vim-tiny python python-dev python-setuptools libicu-dev libavahi-compat-libdnssd-dev curl
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py
pip install RPi.GPIO
useradd -m -d /data/red -s /bin/bash red
adduser red dialout
adduser red tty
cp sudoers /etc/sudoers
npm install -g pm2
cp package.json /data/red/

5
bootstrap-red Executable file
View File

@ -0,0 +1,5 @@
#!/usr/bin/env bash
cd /data/red
npm install

19
package.json Normal file
View File

@ -0,0 +1,19 @@
{
"name": "red",
"version": "1.0.0",
"description": "quick red install",
"main": "./node_modules/node-red/red.js",
"author": "Aiko Mastboom",
"license": "MIT",
"dependencies": {
"node-red": "0.10.6",
"mongodb": "2.0.28",
"redis": "0.12.1",
"rpi-gpio": "0.5.1",
"arduino-firmata": "0.3.2",
"node-red-contrib-freeboard": "0.0.5",
"node-red-node-discovery": "0.0.6",
"node-red-node-snmp": "0.0.2"
}
}

28
sudoers Normal file
View File

@ -0,0 +1,28 @@
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
# Host alias specification
# User alias specification
# Cmnd alias specification
# User privilege specification
root ALL=(ALL:ALL) ALL
red ALL=(ALL) NOPASSWD: /usr/bin/python
# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL
# See sudoers(5) for more information on "#include" directives:
#includedir /etc/sudoers.d