OpenDXL Node-RED Docker

  • opendxl added a new solution:

  • Would be great to have OpenDXL Python Libs on the docker image, so that we can use Python-based Nodes too.

    Agreed. We could definitely add the common OpenDXL libraries by default, but the intent is to allow for any set of Python libraries to be installed.


    To install a Python package you can do the following (after opening a shell in the container):

    Shell-Script: Install Python Package
    1. cd /data
    2. source node-red-py2-env/bin/activate
    3. pip install <package>


    If you want to install a NPM package you can do the following (after opening a shell in the container):

    Shell-Script: Install NPM Package
    1. cd /data
    2. npm install <package> --save


    Also, it is important to map an external volume to the "/data" VOLUME. This allows any installed packages (and flows) to persist when the Node-RED image is upgraded.


    Thanks,

    Chris

  • Another interesting way to install Python packages is from within Node-RED itself. I have attached a flow that allows for specifying a set of Python packages to install (space delimited) in the "packages to install" node.


    I also added another flow that displays the current version of the Python DXL client that is installed.




    The code for the flow is as follows:


    Thanks,

    Chris