initial commit

This commit is contained in:
Frank Adaemmer 2022-11-29 21:12:24 +01:00
commit d98d8b26a3
3 changed files with 36 additions and 0 deletions

14
Dockerfile Normal file
View 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
View 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
View 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"
}