Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Anybody got this working in Docker? #33

Open
IoTPlay opened this issue Oct 6, 2018 · 5 comments
Open

Anybody got this working in Docker? #33

IoTPlay opened this issue Oct 6, 2018 · 5 comments

Comments

@IoTPlay
Copy link

IoTPlay commented Oct 6, 2018

Anybody got this up and running in Docker? I still get this error:

logging to file /var/log/paradoxip.log
ERROR:root:******************* Error reading config.ini file (will use defaults): No section: 'Application'
reading  config
Traceback (most recent call last):
  File "/usr/src/app/ParadoxIP150v2/IP150-MQTTv2.py", line 955, in <module>
    logging.error( "MQTT connection error (" + str(attempts) + ": " + e.strerror)
AttributeError: 'exceptions.AttributeError' object has no attribute 'strerror'
@psyciknz
Copy link
Contributor

psyciknz commented Oct 6, 2018 via email

@IoTPlay
Copy link
Author

IoTPlay commented Oct 6, 2018

Here is my Dockerfile:

FROM python:2-alpine

RUN apk update              && \
    apk add --no-cache         \
    git

WORKDIR /usr/src/app
RUN git clone https://github.com/Tertiush/ParadoxIP150v2.git
RUN chmod +x /usr/src/app/ParadoxIP150v2/IP150-MQTTv2.py
# I run the command in a folder where the config.ini is - that has all my settings
COPY config.ini /usr/src/app/ParadoxIP150v2
CMD ["python","/usr/src/app/ParadoxIP150v2/IP150-MQTTv2.py"]

@psyciknz
Copy link
Contributor

psyciknz commented Oct 6, 2018

Here is my docker file, the
FROM BASEIMAGE_ARCH/python:2.7.15-jessie

__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 requests

# build /opt/mqttwarn
RUN mkdir -p /opt/paradox
WORKDIR /opt/paradox

# add user paradox to image
RUN groupadd -r paradox && useradd -r -g paradox paradox
RUN chown -R paradox /opt/paradox

# process run as paradox user
USER paradox

# conf file from host
VOLUME ["/opt/paradox/conf"]

# set conf path
ENV PARADOXINI="/opt/paradox/conf/config.ini"

# finally, copy the current code (ideally we'd copy only what we need, but it
#  is not clear what that is, yet)
COPY . /opt/paradox

# run process
CMD python IP150-MQTTv2.py

I'll confirm if I made any changes to the code to support the config file like this, but I believe I did make alterations to the logging so it uses syslog.

@psyciknz
Copy link
Contributor

psyciknz commented Oct 6, 2018

If you want (or tertuish does as well) you can look at my fork...and if it's still good for everyone (as it not just SP panels as I added a log of status reporting from those for battery voltage etc). Then I can PR it back to the main fork. But this includes my docker file....it's called a cross, and I have a build script for building arm64v8, arm32v6 and amd64. I'll need to add more files into the fork to explain this. Here's the link: https://github.com/psyciknz/ParadoxIP150v2 It was forked a while ago, so I'm not sure the state compared to the original.

@IoTPlay
Copy link
Author

IoTPlay commented Oct 6, 2018

👍

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants