Skip to content

Commit b009b24

Browse files
author
Stephan van Rooij
committed
feat: Added dockerfile
1 parent 6eeb0a4 commit b009b24

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

Dockerfile

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM node:boron-alpine
2+
3+
ENV IPCAM2MQTT_PORT=8021
4+
5+
WORKDIR /usr/ipcam2mqtt
6+
7+
COPY package.json package-lock.json ./
8+
9+
RUN npm install --production
10+
11+
COPY . .
12+
13+
EXPOSE 8021
14+
15+
CMD ["node","index.js"]

README.md

+12
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,18 @@ pm2 start ipcam2mqtt -x -- [regular-options]
9494
pm2 start ipcam2mqtt -x -- -n cameras -m mqtt://your.mqtt.host:1883
9595
```
9696

97+
## Docker
98+
99+
You can also run this bridge on docker. Be sure to specify your own mqtt connection string! This command connects port `8821` (you can change this) to the container where the bridge runs at `8021`.
100+
101+
You can also set the other properties by using the `-e "IPCAM2MQTT_...=newvalue"` argument. All the properties can be set with the prefix `IPCAM2MQTT_` followed by the full name.
102+
103+
```bash
104+
docker run -d -e "IPCAM2MQTT_MQTT=mqtt://your.mqtt.nl:1883" -p 8821:8021 --name ipcam2mqtt svrooij/ipcam2mqtt:latest
105+
# Open (and follow) the logs
106+
docker logs ipcam2mqtt -f
107+
```
108+
97109
## Special thanks
98110

99111
This bridge is inspired on [hue2mqtt.js](https://github.com/hobbyquaker/hue2mqtt.js) by [Sabastian Raff](https://github.com/hobbyquaker). That was a great sample on how to create a globally installed, command-line, something2mqtt bridge.

0 commit comments

Comments
 (0)