File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed
Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM python:3.7.9
2+
3+ # based on https://github.com/pfichtner/docker-mqttwarn
4+
5+ # install python libraries (TODO: any others?)
6+ # RUN pip install paho-mqtt broadlink
7+
8+ # build /opt/mqttwarn
9+ RUN mkdir -p /opt/broadlink-mqtt
10+ WORKDIR /opt/broadlink-mqtt
11+ RUN mkdir -p /var/log/broadlink
12+
13+ COPY ./requirements.txt /opt/broadlink-mqtt
14+ RUN pip install -r /opt/broadlink-mqtt/requirements.txt
15+
16+
17+ # add user mqttwarn to image
18+ RUN groupadd -r broadlink && useradd -r -g broadlink broadlink
19+ RUN chown -R broadlink:broadlink /opt/broadlink-mqtt
20+ RUN chown -R broadlink:broadlink /var/log/broadlink
21+ # RUN chown -R broadlink /home/broadlink
22+
23+ # process run as mqttwarn user
24+ USER broadlink
25+
26+ # conf file from host
27+ VOLUME ["/opt/broadlink-mqtt/conf" ]
28+
29+ # commands dir
30+ VOLUME ["/opt/broadlink-mqtt/commands/" ]
31+
32+ # set conf path
33+ ENV BROADLINKMQTTCONF="/opt/broadlink-mqtt/conf/mqtt.conf"
34+ ENV BROADLINKMQTTCONFIGCUSTOM="/opt/broadlink-mqtt/conf/custom.conf"
35+
36+ # finally, copy the current code (ideally we'd copy only what we need, but it
37+ # is not clear what that is, yet)
38+ COPY . /opt/broadlink-mqtt
39+
40+ # run process
41+ CMD python mqtt.py
You can’t perform that action at this time.
0 commit comments