Openhab-cloud setup docker/lxc container

Hey there,

I wanted to install an openhab-cloud instance by myself.
Setup seems to look good but there are some points, I’m having problems with.

I tried a normal installation and also a Docker installation, both ways fail.

In the Quick Start guide on the Github page there is following line of software, which should be installed:

sudo apt-get install build-essential redis-server mongodb nginx python

python is not found, I think you should replace this with python3, furthermore mongodb is also not found, I tried to use the mongodb-org installation from Mongodb install

After those changes, npm install worked and redis is also working. I created a new config.json from config-production.json.

If I now run, node app.js i get an error.

{"errno":-2,"syscall":"open","code":"ENOENT","path":"certs/aps/AuthKey.p8"}

I will try to remove this from the config.json and give feedback.

I have also seen, that in the config-production.json there is also no port 3000 instead port 443 is used, but nginx is working with port 3000, if I see this correct.

"system": {
      "host": "<your-openhab-cloud-host>",
      "port": "443",
      "protocol": "https",
      "logger" : {
        "dir": "./logs",
        "maxFiles" : "7d",
        "level" : "debug",
        "morganOption" : null

When I try to use Docker instead of a normal installation. If I now run docker-compose up -d with the pre-build image, I get following error:

Step 8/14 : RUN apk add --no-cache --virtual .build-deps build-base python && npm install && npm rebuild bcrypt --build-from-source && apk del .build-deps
—> Running in ad36bc641f1a
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
python (no such package):
required by: .build-deps-20220510.090833[python]
The command ‘/bin/sh -c apk add --no-cache --virtual .build-deps build-base python && npm install && npm rebuild bcrypt --build-from-source && apk del .build-deps’ returned a non-zero code: 2
ERROR: Service ‘app’ failed to build : Build failed

When I now change python to python3 in Dockerfile, the build is successfull. But I get an error 404 page not found, I tried to reach http://host:3000, port 80 and https 443.

Hopefully you guys have some advice for me. thanks in advance.

I have now remove the line for authkey and I get following error message:

root@openhab-cloud:~/openhab-cloud# node app.js
internal/modules/cjs/loader.js:638
throw err;
^

Error: Cannot find module ‘winston’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object. (/root/openhab-cloud/logger.js:7:15)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions…js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)

In this post

I uploaded the configuration that I am using.
It is not using docker/lxc container but maybe that helps to do the configuration for the different components e.g. nginx as you got 404 error message.