openHAB-cloud Docker (docker-compose) Setup

Tags: #<Tag:0x00007efebe986070> #<Tag:0x00007efebe985ee0>

Hi all,

we have added docker-compose functionality to the openHAB-cloud.
You can find instructions in the updated README.

At the moment there is SSL missing, but we are on it to add Lets Encrypt support to it among other improvements.
It will be added soon and is listed as Limitations:

  • Lets Encrypt SSL is missing in the images and will be added soonThe nginx configuration at
  • /etc/nginx_openhabcloud.conf will be reused

Looking foward for your feedback.
Thanks & BR
Mehmet

For Quick setup install docker, just clone the openhab-cloud repo, adjust the configs according your URL and the README and hit

docker-compose up -d

in the root of the openhab-cloud.

BR Mehmet

this look great… testing right now…! Thanks

1 Like

I get problems with nginx.

I have problems to understand what you should do in which config files
Can you help me?

1 Like

Of Course! Therefor we are here…

What is the problem? Did you follow the steps in the readme?
Can you provide more infos, like OS, detailled logs etc

I try follow the docker setup for MyOpenHab. I was confused chapter Configuration in the Docker installation. I am new to Docker, so I was wondering if I had to change the host for mogodb and rdis. How do I find the actual host?
And what happen with t nginx startup? I get errors. I don’t know nginx either and I have problems to understand what modification I have to do with the setup file for this. Can you please expalin more detailed?
I have installed docker on windows 10

I “solve” this. There was a port conflict. I am already using port 80. So I map port 80 to port 85. Would that be any problem?

I also get this “bcrypt” error. How can i fix that in the Docker image?
I suppose I have to start the images without the command, but that’s not easy. Any tips?

this was fixed already

Is it possible to use an existing certificate on host ?

I’m using the docker image on my Synology NAS and I’m already using a Let’s Encrypt certificate on my NAS.

Hi Marzima,

Thank you for creating this dockerized version.

I am correct the config.json should be in root folder (thus openhab-cloud/) and not in the openhab-cloud/deployment/?

I adapted the config.json as stated in the README file, so this means WITH user and password for mongodb?
I have it now as followed:

    "mongodb": {
        "hosts": ["mongodb"],
        "db": "openhab",
        "user": "",
        "password": ""
    },
    "redis": {
        "host": "redis",
        "port": "6379",
        "password": "password"
    },

Or did I take the readme to literately?

Anywho, I get errors from the mongodb container with the exit code 100.

Error while connecting from openHAB-cloud to mongodb: MongoError: getaddrinfo ENOTFOUND mongodb mongodb:27017

and

Error while connecting from openHAB-cloud to mongodb: MongoError: connect EHOSTUNREACH 172.22.0.4:27017

docker ps gives me:

So, as you see, most probably it has to do with the config.json
Hope you can help to give me a nice containerized openhab-cloud expierence! Thanks

I have the same Problem.

Fresh VM with Ubuntu 16.04.

Docker-compose runs fine.

After all the container with mongodb restarts all the Time.

Please fix the Container.

THANKS

I think you should give a pw and user.
I will double check it…

BR Mehmet

Same here.

I checked

docker-compose logs mongodb

exception in initAndListen: IllegalOperation: Attempted to create a lock file on a read-only directory: /data/db, terminating

Hi,
If I read the documentation correctly , we need to first setup mongodb and redis images first before running the OpenhabCloud docker image.

Isn’t it possible to have just 1 docker image, with everything already pre-configured (mongodb, redis, nginx) ?

In my mind, the idea of docker was to avoid dependencies, and having to use multiple images defeats this purpose.
Correct me if I am wrong of course.

And thanks again for all your work.

I had also problems to install openhab cloud correctly.
MongoDB showed the same error.

I found the solution in an open issue in the repo:
With the fixed docker-compose file it is just start and play :wink:
After everything started up modify the config files direct in the volume or copy your nginx and openhab config via docker cp to the correct places in the volume.
Thank you very much @Luca_Calcaterra!!!

I will take a look and fix it

The docker is still not working… did you fix it ? still the same read lock error among others. Moreover, the doc is not really reflecting files in the repo… could you please update it ?

Yes, I will care for it. I am planing to fix it this weekend.

BR Mehmet

Hi

As per the readme it says if i wish to make changes to the config.json i need to do the following to the docker-compose file … however i cant find those lines in the file … where do i make this change ?

As per readme below …

If you want to customize the openhab-cloud app or change e.g. configurations within config.json , you need to switch to the local build of the node app. Adjust the build stratgy in the docker-compose.yml and replace the image section of docker-compose.yml with the following lines, to not use the official docker hub images anymore and switch to your local sources as base for the app-1 image:

```

  • context: ./*
  • dockerfile: ./docker/node/Dockerfile*
    ```