Page 10 of 11

Re: Oficial Docker Container

Posted: Thursday 09 February 2023 18:29
by nitpicker
even sudo docker volume create portainer_data results in nothing...

Re: Oficial Docker Container

Posted: Thursday 09 February 2023 18:32
by Sjonnie2017
What do you mean? How do you check? "results in nothing" says... well simply... nothing ;)

Re: Oficial Docker Container

Posted: Thursday 09 February 2023 18:35
by nitpicker
when I click 'Enter'. Then the cursus moves to a new line and nothing happens until I click 'CTRL-C'.

Re: Oficial Docker Container

Posted: Thursday 09 February 2023 19:20
by Sjonnie2017
I think you should best start over. And you might want to read the documentation on docker and docker-compose. This is not meant as a down play but you should get the basics before you endeavour into Dockerization.

Re: Oficial Docker Container

Posted: Thursday 09 February 2023 19:25
by waltervl
For the docker users here, is the system reboot function (menu setup - reboot) working in a Domoticz Docker? Asking for viewtopic.php?f=6&t=39878

Re: Oficial Docker Container

Posted: Friday 10 February 2023 7:31
by Sjonnie2017
waltervl wrote: Thursday 09 February 2023 19:25 For the docker users here, is the system reboot function (menu setup - reboot) working in a Domoticz Docker? Asking for viewtopic.php?f=6&t=39878
I haven't tested because restarting the container is fast and efficient enough.

Re: Oficial Docker Container

Posted: Friday 10 February 2023 9:25
by gizmocuz
nitpicker wrote: Thursday 09 February 2023 17:29 I don't know why, but I cannot start containers.

Docker compose can be installed with

Code: Select all

sudo apt-get update && sudo apt-get upgrade

curl -fsSL test.docker.com -o get-docker.sh && sh get-docker.sh
sudo usermod -aG docker ${USER}
sudo systemctl enable docker
sudo reboot
From this moment you should not have to use 'sudo'

Anyway, you should also not chmod +x the docker compose configuration file (docker-compose.yml)

There is also no need to create any volumes as the configuration file of the Domoticz docker compose file already does this for you

Code: Select all

volumes:
      - ./data:/opt/domoticz/userdata
What the above means is, create a local volume 'data' (./data)
This is great as here is stored everything you need.
Make a backup of this folder (or even better, the folder where you placed the docker-compose.yml file in (here will also be the data folder created)

To start the domoticz docker you then issue

Code: Select all

docker compose up -d
or for previous docker-compose installations

Code: Select all

docker-compose up -d
(note the dash between docker and compose)

That's all, and now you should be able to browse to port 8080 of this machine

If you need to connect a USB device to the docker

issue

ls -al /dev/serial/by-id

you should see your serial devices

Next you edit the file docker-compose.yml

Code: Select all

# devices:
    #   - "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
remove the # infront of the lines (take care of the indenting of the lines!)

make sure the serial line contains the right path (that you found above)

instead of /dev/ttyACM0 you can use /dev/ttyUSB0 and/or /dev/ttyUSB1

next you restart the docker container with

docker compose restart

or
docker compose stop
docker compose up -d

Now when you refresh the hardware page in domoticz, you should see the serial port

And that's it

And as said, please do some reading about docker-compose, you need to do it once and it will give you pleasure for the rest of live :mrgreen:

Re: Oficial Docker Container

Posted: Monday 13 February 2023 11:39
by nitpicker
It is working now, thanks for your help.

Domoticz, mqtt and portainer are all working in their docker containers.

Re: Oficial Docker Container

Posted: Tuesday 14 February 2023 6:25
by hoeby
waltervl wrote: Thursday 09 February 2023 19:25 For the docker users here, is the system reboot function (menu setup - reboot) working in a Domoticz Docker? Asking for viewtopic.php?f=6&t=39878
This doesn't work in docker.
I run the latest stable, maybe if something if changed, it works in the beta. I can't test beta, because i only want to run stable versions

Re: Oficial Docker Container

Posted: Tuesday 14 February 2023 6:58
by kiddigital
Reboot function probably does not work as the containers stops automatically when the Domoticz process stops.

So when requesting a reboot, processes stop and the container exits.

But you can specify ‘—restart unless-stopped’ as docker command parameter which restarts a stopped container.

Re: Oficial Docker Container

Posted: Sunday 30 July 2023 18:20
by hjzwiers
Why doesn't anyone post a working set of docker compose files for the less competent under us ....

I have a running zwave-js, domoticz running under docker containers set up through docker compose. I set up mosquitto direcly because I could not set this up through docker. It was supposed to be a smooth transition, but I am already working on it for two days .....

I would like to setup swag though a container as well

I have also setup portainer directly.

I found out why I could not connect to the Zwave stick, found someone with the same problem: solved

I have still have trouble with nefiteasyhttpserver, which uses the same port 3000 as zwave-js .....
I have trouble with getting acces from outside though 4443:443, but i am looking for the files I need to add to get this right. I have looked for an good tutorial but there is none .....

version: '3.3'

services:
domoticz:
container_name: domoticz
image: domoticz/domoticz:latest
restart: unless-stopped
devices:
- "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0"
ports:
- "8080:8080"
- “4443:443”
volumes:
- ./domoticz/config:/opt/domoticz/userdata
environment:
- TZ=Europe/Amsterdam
networks:
- domoticz
- proxy

version: '3.7'
services:
zwave-js-ui:
container_name: zwave-js-ui
image: zwavejs/zwave-js-ui:latest
restart: always
tty: true
stop_signal: SIGINT
environment:
- SESSION_SECRET=mysupersecretkey
- ZWAVEJS_EXTERNAL_CONFIG=/usr/src/app/store/.config-db
# Uncomment if you want logs time and dates to match your timezone instead of UTC
# Available at https://en.wikipedia.org/wiki/List_of_t ... time_zones
- TZ=Europe/Amsterdam
networks:
- zwave
devices:
# Do not use /dev/ttyUSBX serial devices, as those mappings can change over time.
# Instead, use the /dev/serial/by-id/X serial device for your Z-Wave stick.
- '/dev/serial/by-id/usb-0658_0200-if00:/dev/zwave'
volumes:
- /home/hjz/docker/zwjs/store:/usr/src/app/store
ports:
- '8091:8091' # port for web interface
- '3000:3000' # port for Z-Wave JS websocket server
networks:
zwave:
volumes:
zwave-config:
name: zwave-config

Re: Oficial Docker Container

Posted: Sunday 30 July 2023 22:31
by andreo
here is my compose file

Code: Select all

version: '3.3'
services:
    rpi-influxdb:
        restart: always
        ports:
            - '8086:8086'
        container_name: myInfluxDB
        volumes:
            - '/var/mydata/influxdb:/data'
        image: hypriot/rpi-influxdb
    
    grafana:
        restart: always
        ports:
            - '3010:3000'
        volumes:
            - '/var/lib/grafana:/grafana_data'
        container_name: myGrafana
        image: grafana/grafana
    
    eclipse-mosquitto:
        restart: always
        ports:
            - '1883:1883'
            - '9001:9001'
        container_name: myMosquitto
        volumes:
            - '/var/mydata/mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf'
            - '/var/mydata/mosquitto/data:/mosquitto/data'
            - '/var/mydata/mosquitto/log:/mosquitto/log'
        image: 'eclipse-mosquitto:latest'
    
    node-red:
        restart: always
        ports:
            - '1880:1880'
        volumes:
            - '/var/mydata/nodered/data:/data'
        container_name: myNodered
        image: 'nodered/node-red:latest'
    
    domoticz:
        image: domoticz/domoticz:beta
        container_name: myDomoticz
        restart: unless-stopped
            # Pass devices to container
        devices:
            - "/dev/serial/by-id/usb-Arduino__www.arduino.cc__Arduino_Mega_2560_852353331353518060D0-if00:/dev/ttyACM0"
            - "/dev/snd/:/dev/snd/"
        ports:
            - "8080:8080"
            - "8088:8088"
            - "8443:443"
            - "5000:5000"
            - "1012:1012"
            - "49000:49000"
        volumes:
            - ./userdata:/opt/domoticz/userdata
        environment:
            - TZ=Europe/Amsterdam
            - LOG_PATH=/opt/domoticz/userdata/domoticz.log

    nefiteasy-http-server:
        restart: always
        ports:
            - '3000:3000'
        container_name: myNefitEasy
        environment:
            - NEFIT_SERIAL_NUMBER=4180xxxxx
            - NEFIT_ACCESS_KEY=BNBsFYnZ4S6xxxxx
            - NEFIT_PASSWORD=xxxx
        image: trafex/nefiteasy-http-server

    duplicati:
        image: lscr.io/linuxserver/duplicati:latest
        container_name: myDuplicati
        environment:
            - PUID=1000
            - PGID=1000
            - TZ=Etc/UTC
            - CLI_ARGS= #optional
        volumes:
            - /var/mydata/duplicati:/config
            - /var/mydata:/source
            - /opt:/source     
        ports:
            - 8200:8200
        restart: unless-stopped
This install the next containers: NodeRed | NefitEasy | Duplicati | Grafana | Mosquitto | InfluxDB and Domoticz

Re: Oficial Docker Container

Posted: Monday 31 July 2023 8:21
by hjzwiers
Wow, it seems as though you took care of domotics and nefit

How is acces from the outside with this setup?
And I also have IDetect running whish needs tweaking also.

But this seems like a good way to start! I may give it a go. I wonder how I can make the transition of 35 Zwave devices better than it is with the current setup.

Re: Oficial Docker Container

Posted: Monday 31 July 2023 12:31
by hjzwiers
I also see that you do not run from Zwave-js ....

Re: Oficial Docker Container

Posted: Monday 31 July 2023 23:16
by andreo
hjzwiers wrote: Monday 31 July 2023 8:21 Wow, it seems as though you took care of domotics and nefit

How is acces from the outside with this setup?
And I also have IDetect running whish needs tweaking also.

But this seems like a good way to start! I may give it a go. I wonder how I can make the transition of 35 Zwave devices better than it is with the current setup.
I connect from the outside using a VPN and I do not use any Zwave devices

Re: Oficial Docker Container

Posted: Tuesday 01 August 2023 15:27
by hjzwiers
I now see that Zwave-js uses port 3000 and nefit also uses that poort, so i need to change this but I am wondering which one

Re: Oficial Docker Container

Posted: Tuesday 01 August 2023 16:17
by waltervl
The ZwaveJS one as that is not used by Domoticz and others. It is used by HomeAssistant (WebSocket integration)

Re: Oficial Docker Container

Posted: Tuesday 01 August 2023 22:06
by Marathon2010
hjzwiers wrote: Tuesday 01 August 2023 15:27 I now see that Zwave-js uses port 3000 and nefit also uses that poort, so i need to change this but I am wondering which one
I've implemented ZWaveJS2MQTT mid last year under docker. I'm using port 8091 to open control panel of Zwave. Does that help?

Re: Oficial Docker Container

Posted: Wednesday 02 August 2023 12:46
by hjzwiers
Then why do I see port 3000 in every script?

Re: Oficial Docker Container

Posted: Wednesday 02 August 2023 12:55
by waltervl
hjzwiers wrote: Wednesday 02 August 2023 12:46 Then why do I see port 3000 in every script?
As that is a default of ZwavejsUI for HomeAssistant integration? But not related to Domoticz docker so slightly off topic in this discussion.
You can use 3010:3000 to move the original 3000 to 3010 to get it out of Nefiteasy http server