-
-
Notifications
You must be signed in to change notification settings - Fork 249
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c8a5aa9
Showing
6 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
test-volume |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM node:7.7.2-alpine | ||
|
||
RUN apk add --no-cache git python make g++ libffi-dev openssl-dev avahi-compat-libdns_sd avahi-dev openrc dbus | ||
|
||
RUN npm install --silent -g homebridge | ||
|
||
RUN mkdir /homebridge && mkdir -p /home/root/homebridge | ||
WORKDIR /homebridge | ||
|
||
COPY default.package.json /home/root/homebridge | ||
COPY default.config.json /home/root/homebridge | ||
COPY entrypoint.sh /sbin/entrypoint.sh | ||
|
||
VOLUME /homebridge | ||
|
||
ENTRYPOINT ["/sbin/entrypoint.sh"] | ||
|
||
CMD ["homebridge", "-U", "/homebridge", "-P", "/homebridge/node_modules"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Docker Homebridge | ||
|
||
This a lightweight alpine-based docker image allows you to run [Nfarina's](https://github.com/nfarina) [Homebridge](https://github.com/nfarina/homebridge) on your home network that emulates the iOS HomeKit API. | ||
|
||
## Compatibility | ||
|
||
Homebridge requires full access to your local network to function correctly which can be achieved using the ```--net=host``` flag. | ||
Currently this will not work when using [Docker for Mac](https://docs.docker.com/docker-for-mac/) due to [this issue](https://github.com/docker/for-mac/issues/68). | ||
|
||
## Usage | ||
|
||
Quick Setup: | ||
|
||
```shell | ||
docker run --net=host -v </path/to/config>:/homebridge oznu/homebridge | ||
``` | ||
|
||
## Config | ||
|
||
The Homebridge config file is located at **/</path/to/config>/config.json*** | ||
This file will be created the first time you run the container with a sample [FakeBulb](https://www.npmjs.com/package/homebridge-fakebulb) accessory. | ||
|
||
## Plugins | ||
|
||
Plugins should be defined in the **/</path/to/config>/package.json** file in the standard NPM format. | ||
This file will be created the first time you run the container with the [FakeBulb](https://www.npmjs.com/package/homebridge-fakebulb) module. | ||
|
||
Any plugins added to the **package.json** will be installed each time the container is restarted. | ||
Plugins can be uninstalled by removing the entry from the **package.json** and restarting the container. | ||
|
||
## Troubleshooting | ||
|
||
### 1. Verify your config.json and package.json syntax | ||
|
||
Many issues appear because of invalid JSON. A good way to verify your config is to use the jsonlint.com validator. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{ | ||
"bridge": { | ||
"name": "Homebridge", | ||
"username": "CC:22:3D:E3:CE:30", | ||
"port": 51826, | ||
"pin": "031-45-154" | ||
}, | ||
|
||
"description": "This is an example configuration file. You can use this as a template for creating your own configuration file containing devices you actually own.", | ||
|
||
"accessories": [ | ||
{ | ||
"accessory": "FakeBulb", | ||
"name": "Fake Light" | ||
} | ||
], | ||
|
||
"platforms": [ | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"dependencies": { | ||
"homebridge-fakebulb": "^0.0.3" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/sh | ||
|
||
dbus-daemon --system | ||
avahi-daemon -D | ||
|
||
[ -f /homebridge/package.json ] || cp /home/root/homebridge/default.package.json /homebridge/package.json | ||
[ -f /homebridge/config.json ] || cp /home/root/homebridge/default.config.json /homebridge/config.json | ||
|
||
echo "Removing old plugins..." | ||
npm prune | ||
echo "Installing plugins..." | ||
npm install --silent | ||
|
||
exec "$@" |