forked from eschava/broadlink-mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dockerfile
41 lines (28 loc) · 1002 Bytes
/
dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#FROM __BASEIMAGE_ARCH__/python:2.7.15-jessie
#FROM python:2.7.15-jessie
FROM python:3.9.0-slim
#__CROSS_COPY qemu/qemu-__QEMU_ARCH__-static /usr/bin/
# based on https://github.com/pfichtner/docker-mqttwarn
# install python libraries (TODO: any others?)
RUN pip install paho-mqtt broadlink
# build /opt/mqttwarn
RUN mkdir -p /opt/broadlink-mqtt
WORKDIR /opt/broadlink-mqtt
RUN mkdir -p /var/log/broadlink
# add user mqttwarn to image
RUN groupadd -r broadlink && useradd -r -g broadlink broadlink
RUN chown -R broadlink /opt/broadlink-mqtt
RUN chown -R broadlink /var/log/broadlink
# process run as mqttwarn user
USER broadlink
# conf file from host
VOLUME ["/opt/broadlink-mqtt/conf"]
# commands dir
VOLUME ["/opt/broadlink-mqtt/commands/"]
# set conf path
ENV BROADLINKMQTTCONF="/opt/broadlink-mqtt/conf/mqtt.conf"
# finally, copy the current code (ideally we'd copy only what we need, but it
# is not clear what that is, yet)
COPY . /opt/broadlink-mqtt
# run process
CMD python mqtt.py