initial commit
This commit is contained in:
commit
d98d8b26a3
14
Dockerfile
Normal file
14
Dockerfile
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
FROM python:3
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
RUN python -m pip install --no-cache-dir maxcube-api paho-mqtt \
|
||||
&& python -m pip install --no-cache-dir git+https://github.com/copyrights/python-maxcube-api.git@more_to_dict \
|
||||
&& python -m pip install --no-cache-dir git+https://github.com/copyrights/maxcube-mqtt.git@forDocker
|
||||
|
||||
COPY maxcube.json entrypoint .
|
||||
|
||||
ENTRYPOINT ["./entrypoint"]
|
||||
|
||||
CMD ["maxcube-mqtt","./maxcube.json"]
|
||||
|
||||
12
entrypoint
Executable file
12
entrypoint
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ -n "$MQTT_HOST" ]
|
||||
then
|
||||
sed -i "s|^ \"mqtt_host\": \".*\",| \"mqtt_host\": \"$MQTT_HOST\",|" "maxcube.json"
|
||||
fi
|
||||
|
||||
if [ -n "$MQTT_PASSWORD" ]
|
||||
then
|
||||
sed -i "s|^ \"mqtt_password\": \".*\",| \"mqtt_password\": \"$MQTT_PASSWORD\",|" "maxcube.json"
|
||||
fi
|
||||
exec "$@"
|
||||
10
maxcube.json
Normal file
10
maxcube.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"cube_host": "maxcube.lan",
|
||||
"cube_port": "62910",
|
||||
"mqtt_client_id": "maxcube",
|
||||
"mqtt_host": "localhost",
|
||||
"mqtt_port": "1883",
|
||||
"mqtt_user": "maxcube",
|
||||
"mqtt_password": "",
|
||||
"mqtt_topic_prefix": "heizung"
|
||||
}
|
||||
Loading…
Reference in a new issue