Browse Source

Initial code commit

Image builds and container runs. Running into an issue with node and
needs documentation.
node-8-crossarch
ViViDboarder 5 years ago
parent
commit
9649305adf
  1. 3
      .gitignore
  2. 32
      Dockerfile
  3. 14
      Makefile
  4. 24
      config-sample.json
  5. 6
      docker-compose.yaml
  6. 2
      plugins-sample.txt

3
.gitignore

@ -0,0 +1,3 @@
config.json
plugins.txt
tags

32
Dockerfile

@ -0,0 +1,32 @@
FROM hypriot/rpi-node:7
# FROM hypriot/rpi-node:6.9.1
MAINTAINER ViViDboarder <vividboarder@gmail.com>
ENV LANG en_US.UTF-8
ENV LC_ALL en_US.UTF-8
RUN apt-get update
RUN apt-get install -y --no-install-recommends \
build-essential \
avahi-daemon \
avahi-discover \
libnss-mdns \
libavahi-compat-libdnssd-dev
RUN npm install -g --unsafe-perm \
homebridge \
hap-nodejs \
node-gyp && \
cd /usr/local/lib/node_modules/homebridge/ && \
npm install --unsafe-perm bignum && \
cd /usr/local/lib/node_modules/hap-nodejs/node_modules/mdns && \
node-gyp BUILDTYPE=Release rebuild
USER root
RUN mkdir -p /root/.homebridge
VOLUME /root/.homebridge
WORKDIR /root/.homebridge
EXPOSE 5353 51826
CMD cat /root/.homebridge/plugins.txt | xargs npm install -g --unsafe-perm && homebridge

14
Makefile

@ -0,0 +1,14 @@
build:
docker build -t rpi-homebridge .
run: build
docker run --net=host --rm \
-v "$(shell pwd)/config.json:/root/.homebridge/config.json" \
-v "$(shell pwd)/plugins.txt:/root/.homebridge/plugins.txt" \
rpi-homebridge
shell: build
docker run --net=host --rm \
-v "$(shell pwd)/config.json:/root/.homebridge/config.json" \
-v "$(shell pwd)/plugins.txt:/root/.homebridge/plugins.txt" \
-it rpi-homebridge bash

24
config-sample.json

@ -0,0 +1,24 @@
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-154"
},
"description": "This is an example configuration file with one fake accessory and one fake platform. You can use this as a template for creating your own configuration file containing devices you actually own.",
"accessories": [
{
"accessory": "WeMo",
"name": "Coffee Maker"
}
],
"platforms": [
{
"platform" : "PhilipsHue",
"name" : "Hue"
}
]
}

6
docker-compose.yaml

@ -0,0 +1,6 @@
homebridge:
build: .
net: host
volumes:
- ./config.json:/root/.homebridge/config.json
- ./plugins.txt:/root/.homebridge/plugins.txt

2
plugins-sample.txt

@ -0,0 +1,2 @@
homebridge-homeassistant
homebridge-wemo
Loading…
Cancel
Save