Oficial Docker Container Topic is solved

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Oficial Docker Container

Post by EddyG »

P.S. The dzVents scripts could I only get running by making a symlink of "JSON.lua" because on my Synology there was only 'json.lua' present.
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Oficial Docker Container

Post by waaren »

EddyG wrote: Saturday 13 March 2021 11:52 P.S. The dzVents scripts could I only get running by making a symlink of "JSON.lua" because on my Synology there was only 'json.lua' present.
Your <domoticz dir>/scripts/lua

should contain

Code: Select all

total 104
drwxr-xr-x 3 root root  4096 Feb 27 00:56 .
drwxr-xr-x 8 root root  4096 Feb 27 00:56 ..
-rw-r--r-- 1 root root 59895 Feb 27 00:56 JSON.lua
-rw-r--r-- 1 root root  1870 Feb 27 00:56 script_device_demo.lua
-rw-r--r-- 1 root root  1932 Feb 27 00:56 script_time_demo.lua
-rw-r--r-- 1 root root  5968 Feb 27 00:56 xml2lua.lua
drwxr-xr-x 2 root root  4096 Feb 27 00:56 xmlhandler
-rw-r--r-- 1 root root 12387 Feb 27 00:56 XmlParser.lua
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Oficial Docker Container

Post by EddyG »

I solved it now the other way.
I included in the compose file

Code: Select all

      - ./config/plugins:/opt/domoticz/userdata/plugins
      - ./config/scripts:/opt/domoticz/userdata/scripts
And that works too.
I think that should be included here too: https://hub.docker.com/r/domoticz/domoticz

If you think about it. From the beginning the database and plugins and scripts directories should have been in a 'userdata' directory.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post by waltervl »

If you have in composer (like in the documentation)
volumes:
- ./config:/opt/domoticz/userdata

And in ./config you have 2 folders, plugins and scripts. Then it should also work?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Oficial Docker Container

Post by EddyG »

Yes, but then you have to manually copy the contents from within the docker container to your "./config" path, or like I did before make a symlink in the container from 'json.lua' to 'JSON.lua'
The last method is not persistent.
And I use watchtower just automatically pull the latest image instead of updating manually.
My Docker Domoticz is NOT my production Domoticz.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post by waltervl »

Ok, so if you do it your way (with 2 config folders) the scripts folder from Domoticz docker will be merged with the scripts folder with your own scripts?
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Oficial Docker Container

Post by EddyG »

Not quite, it is more like replaced. The folder, but not the content, from inside the docker container is brought outside the container.
For Domoticz it works like the outside folder(s) are inside the container, and the inside folder is not used anymore by Domoticz.
YOYO
Posts: 27
Joined: Tuesday 09 June 2015 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.23393
Location: The Netherlands
Contact:

Re: Oficial Docker Container

Post by YOYO »

waltervl wrote: Saturday 13 March 2021 13:51 If you have in composer (like in the documentation)
volumes:
- ./config:/opt/domoticz/userdata

And in ./config you have 2 folders, plugins and scripts. Then it should also work?
This doesn't work for me.
Maybe its because im running docker within OMV but i don't have a real composer (Or i dont know how to use the interface).
Can someone fix it otherwise im forced to leave the official Docker Container because i need to reuse my scripts to get my home automation working again.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post by waltervl »

@YOYO did you also try the solution of @EddyG ?

Code: Select all

  - ./config/plugins:/opt/domoticz/userdata/plugins
- ./config/scripts:/opt/domoticz/userdata/scripts
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
YOYO
Posts: 27
Joined: Tuesday 09 June 2015 21:22
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.23393
Location: The Netherlands
Contact:

Re: Oficial Docker Container

Post by YOYO »

waltervl wrote: Wednesday 17 March 2021 20:59 @YOYO did you also try the solution of @EddyG ?

Code: Select all

  - ./config/plugins:/opt/domoticz/userdata/plugins
- ./config/scripts:/opt/domoticz/userdata/scripts
Hi Walter,

Yes i did.
The binding works and the folder appears twice which is logical because in the config i allready have:

Code: Select all

/sharedfolders/Dockerdrive/Domoticz:/opt/domoticz/userdata
But when i put my scripts in that folder and i go to the events page of domoticz it remains empty.
So i dont see my scripts there which is kinda the whole point. :)
EddyG
Posts: 1042
Joined: Monday 02 November 2015 5:54
Target OS: -
Domoticz version:

Re: Oficial Docker Container

Post by EddyG »

You are right. I don't see them either. But I did not look for it, because I manually edit my dzVents script in the folder.
I do not know why.
I think that there is a difference between internal and external events, and that internal events have also so data (sync?) with the database.
Last edited by EddyG on Thursday 18 March 2021 19:35, edited 1 time in total.
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post by waltervl »

I made a new topic to discuss this scripts configuration problem: viewtopic.php?f=47&t=35834
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Oficial Docker Container

Post by DAVIZINHO »

hi guys
i update to the last doker (18/03/2021) and now i have problems with my miio (xiaomi) devices.
do you have problems too?
i dont know if the problem is in the miio side or in the docker :-(
Gianni
Posts: 230
Joined: Saturday 21 July 2018 19:03
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Home@Belgium
Contact:

Re: Oficial Docker Container

Post by Gianni »

i try nog for a few days to get domoticz running into a docker.
I made different yml file but i stil got write errors everyime.
The folder scripts/dzvents/generated does not exist in the container.
im using the official build.

This is a standard non modify yml is u for testing.

This is the error when i import my DB (i test is with a new dzvent but stlill te same error

Code: Select all

 2021-04-04 11:39:38.233 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Tvstraat.lua
2021-04-04 11:39:38.234 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Sensor_Voordeur.lua
2021-04-04 11:39:38.234 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Alles_Uit_Garage.lua
2021-04-04 11:39:38.234 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Alles_Uit_Living.lua
2021-04-04 11:39:38.234 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Motion_Wc.lua
2021-04-04 11:39:38.234 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Motion_Boven.lua
2021-04-04 11:39:38.235 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Gang.lua
2021-04-04 11:39:38.235 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Keuken.lua
2021-04-04 11:39:38.235 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Trap.lua
2021-04-04 11:39:38.235 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/wisssl_living.lua
2021-04-04 11:39:38.234 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Tvstraat.lua
2021-04-04 11:39:38.234 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Sensor_Voordeur.lua
2021-04-04 11:39:38.234 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Alles_Uit_Garage.lua
2021-04-04 11:39:38.234 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Alles_Uit_Living.lua
2021-04-04 11:39:38.234 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Motion_Wc.lua
2021-04-04 11:39:38.234 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Motion_Boven.lua
2021-04-04 11:39:38.235 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Gang.lua
2021-04-04 11:39:38.235 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Keuken.lua
2021-04-04 11:39:38.235 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Trap.lua
2021-04-04 11:39:38.235 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/wisssl_living.lua 
this is the yml file

Code: Select all

version: '3.3'

services:
  domoticz:
    image: domoticz/domoticz
    container_name: domoticz
    restart: unless-stopped
    # Pass devices to container
    devices:
      - /dev/ttyACM0:/dev/ttyACMO
      - /dev/ttyACM1:/dev/ttyACM1
 #   - "/dev/serial/by-id/usb-0658_0200-if00:/dev/ttyACM0"
    ports:
      - "8086:8080"
    volumes:
      - ./config:/opt/domoticz/userdata
    environment:
      - TZ=Europe/Brussels
      #- LOG_PATH=/opt/domoticz/userdata/domoticz.log

this a the rights in de ./config folder

Code: Select all

drwxr-xr-x 3 gianni gianni    4096 Apr  4 10:31 .
drwxr-xr-x 3 gianni gianni    4096 Apr  4 10:28 ..
-rw-r--r-- 1 root   root       236 Apr  4 10:30 domocookie.txt
-rw-r--r-- 1 root   root   1019904 Apr  4 10:45 domoticz.db
-rw-r--r-- 1 root   root     32768 Apr  4 10:46 domoticz.db-shm
-rw-r--r-- 1 root   root   1503832 Apr  4 10:46 domoticz.db-wal
-rw-r--r-- 1 root   root    568497 Apr  4 10:44 ozwcache_0xfacac939.xml
-rw-r--r-- 1 root   root      7003 Apr  4 10:44 OZW_Log.txt
drwxr-xr-x 2 root   root      4096 Apr  4 10:29 plugins
if i change the owner to myself i still cannot write

Code: Select all

drwxr-xr-x 3 gianni gianni   4096 Apr  4 11:16 .
drwxr-xr-x 4 gianni gianni   4096 Apr  4 11:13 ..
-rw-r--r-- 1 gianni gianni 978944 Apr  4 11:16 domoticz.db
-rw-r--r-- 1 gianni gianni  32768 Apr  4 11:18 domoticz.db-shm
-rw-r--r-- 1 gianni gianni  74192 Apr  4 11:18 domoticz.db-wal
-rw-r--r-- 1 gianni gianni  12436 Apr  4 11:17 ozwcache_0xfacac939.xml
-rw-r--r-- 1 gianni gianni   1923 Apr  4 11:17 OZW_Log.txt
drwxr-xr-x 2 gianni gianni   4096 Apr  4 11:13 plugins
-rw-r--r-- 1 root   root      108 Apr  4 11:16 zwscene.xml

Domotic log file

Code: Select all

 2021-04-04 12:16:52.971 Sunrise: 07:16:00 SunSet: 20:25:00
2021-04-04 12:16:52.971 Day length: 13:09:00 Sun at south: 13:50:00
2021-04-04 12:16:52.971 Civil twilight start: 06:42:00 Civil twilight end: 20:58:00
2021-04-04 12:16:52.971 Nautical twilight start: 06:01:00 Nautical twilight end: 21:39:00
2021-04-04 12:16:52.971 Astronomical twilight start: 05:17:00 Astronomical twilight end: 22:23:00
2021-04-04 12:16:52.959 Status: Domoticz V2020.2 (build 13133) (c)2012-2021 GizMoCuz
2021-04-04 12:16:52.959 Status: Build Hash: 399b22fa4, Date: 2021-03-30 14:57:44
2021-04-04 12:16:52.959 Status: Startup Path: /opt/domoticz/
2021-04-04 12:16:53.010 Active notification Subsystems: (0/13)
2021-04-04 12:16:53.021 Starting shared server on: 0.0.0.0:6144
2021-04-04 12:16:53.006 Status: PluginSystem: Started, Python version '3.7.3'.
2021-04-04 12:16:53.012 Status: WebServer(HTTP) started on address: 0.0.0.0 with port 8080
2021-04-04 12:16:53.019 Status: WebServer(SSL) started on address: 0.0.0.0 with port 443
2021-04-04 12:16:53.021 Status: TCPServer: shared server started...
2021-04-04 12:16:53.022 Status: RxQueue: queue worker started...
2021-04-04 12:16:53.841 Status: Incoming connection from: 10.10.20.243
2021-04-04 12:16:53.007 Error: SBFSpot: Could not open configuration file!
2021-04-04 12:16:53.839 Error: CheckAuthToken(ec3d0d15b3f83e7ee830eb9f14336753_MzYxM2Y5OWUtOWZhNy00M2MyLTkyODUtOTFlODNmNGNjZTFj) : session id not found
2021-04-04 12:16:55.023 Status: SBFSpot: Worker started...
2021-04-04 12:16:55.024 Status: NotificationSystem: thread started...
2021-04-04 12:16:55.024 Status: EventSystem: reset all events...
2021-04-04 12:16:55.025 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Tvstraat.lua
2021-04-04 12:16:55.025 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Sensor_Voordeur.lua
2021-04-04 12:16:55.026 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Alles_Uit_Garage.lua
2021-04-04 12:16:55.026 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Alles_Uit_Living.lua
2021-04-04 12:16:55.026 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Motion_Wc.lua
2021-04-04 12:16:55.026 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Motion_Boven.lua
2021-04-04 12:16:55.026 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Gang.lua
2021-04-04 12:16:55.026 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Keuken.lua
2021-04-04 12:16:55.026 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Living.lua
2021-04-04 12:16:55.027 Status: dzVents: Write file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Trap.lua
2021-04-04 12:16:55.027 Status: EventSystem: reset all device statuses...
2021-04-04 12:16:55.116 Status: Python EventSystem: Initalizing event module.
2021-04-04 12:16:55.116 Status: EventSystem: Started
2021-04-04 12:16:55.117 Status: EventSystem: Queue thread started...
2021-04-04 12:16:55.224 Status: RFLink: Using serial port: /dev/ttyACM1
2021-04-04 12:16:55.522 Status: OpenZWave: using config in: /opt/domoticz/Config/
2021-04-04 12:16:55.545 Status: OpenZWave: Starting...
2021-04-04 12:16:55.545 Status: OpenZWave: Version: 1.6-1911-gc6a420ef
2021-04-04 12:16:55.023 Error: SBFSpot: Could not open configuration file!
2021-04-04 12:16:55.025 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Tvstraat.lua
2021-04-04 12:16:55.025 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Sensor_Voordeur.lua
2021-04-04 12:16:55.026 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Alles_Uit_Garage.lua
2021-04-04 12:16:55.026 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Alles_Uit_Living.lua
2021-04-04 12:16:55.026 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Motion_Wc.lua
2021-04-04 12:16:55.026 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Motion_Boven.lua
2021-04-04 12:16:55.026 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Gang.lua
2021-04-04 12:16:55.026 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Keuken.lua
2021-04-04 12:16:55.027 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Living.lua
2021-04-04 12:16:55.027 Error: EventSystem: problem writing file: /opt/domoticz/userdata/scripts/dzVents/generated_scripts/Wissel_Trap.lua
2021-04-04 12:16:56.144 Status: RFLink: Controller Initialized!...
2021-04-04 12:16:56.251 Status: RFLink Detected, Version: 1.1 Revision: 48 Build: 4
2021-04-04 12:16:56.423 Status: OpenZWave: A DNS Error Occurred
2021-04-04 12:16:56.423 Status: OpenZWave: ManufacturerSpecificDB Ready
2021-04-04 12:16:56.023 Error: SBFSpot: Data path empty!
2021-04-04 12:16:57.610 OpenZWave: Value_Added: Node: 20 (0x14), CommandClass: SWITCH BINARY, Label: Switch, Instance: 1, Index: 0
2021-04-04 12:16:57.607 Status: OpenZWave: Driver Ready
2021-04-04 12:16:57.610 Status: OpenZWave: New Node added. HomeID: 4207593785, NodeID: 2 (0x02)
2021-04-04 12:16:57.611 Status: OpenZWave: New Node added. HomeID: 4207593785, NodeID: 3 (0x03)
2021-04-04 12:16:57.611 Status: OpenZWave: New Node added. HomeID: 4207593785, NodeID: 4 (0x04)
2021-04-04 12:16:57.612 Status: OpenZWave: New Node added. HomeID: 4207593785, NodeID: 5 (0x05)
2021-04-04 12:16:57.612 Status: OpenZWave: New Node added. HomeID: 4207593785, NodeID: 6 (0x06)
2021-04-04 12:16:57.613 Status: OpenZWave: New Node added. HomeID: 4207593785, NodeID: 7 (0x07)
2021-04-04 12:16:57.613 Status: OpenZWave: New Node added. HomeID: 4207593785, NodeID: 8 (0x08)
2021-04-04 12:16:57.614 Status: OpenZWave: New Node added. HomeID: 4207593785, NodeID: 9 (0x09) 
test it with this in my yml file
environment:
- PUID=1001
- PGID=1001

if i look into the docker container i'm the owner and have full rights on it but still the same error

Code: Select all

gianni@raspberrypi:/mnt/data/domoticz/userdata $ docker exec -it domoticz /bin/bash
root@545adcf36101:/opt/domoticz# ls -la
total 24904
drwxrwxrwx   1 1001 1001      4096 Apr  4 12:42 .
drwxrwxrwx   1 1001 1001      4096 Mar 31 08:57 ..
drwxrwxrwx 121 1001 1001      4096 Mar 11 08:55 Config
-rwxrwxrwx   1 1001 1001    102633 Mar 24 17:18 History.txt
-rwxrwxrwx   1 1001 1001     35147 Nov  9 13:47 License.txt
-rw-------   1 root root 112689152 Apr  4 12:42 core
-rwxrwxrwx   1 1001 1001  14421880 Mar 31 08:08 domoticz
-rwxrwxrwx   1 1001 1001      4433 Nov  9 13:47 domoticz.sh
-rw-------   1 root root         0 Apr  4 12:42 domoticz_crash.log
drwxrwxrwx   4 1001 1001      4096 Nov  9 13:47 dzVents
drwxrwxrwx   4 1001 1001      4096 Nov  9 13:47 plugins
drwxrwxrwx   8 1001 1001      4096 Nov  9 13:47 scripts
-rwxrwxrwx   1 1001 1001      3414 Nov  9 13:47 server_cert.pem
-rwxrwxrwx   1 1001 1001       779 Nov 29 11:09 updatebeta
-rwxrwxrwx   1 1001 1001       799 Nov 29 11:09 updaterelease
drwxrwxrwx   3 1001 1001      4096 Apr  4 12:42 userdata
drwxrwxrwx  13 1001 1001      4096 Feb 19 08:48 www
root@545adcf36101:/opt/domoticz# cd userdata
root@545adcf36101:/opt/domoticz/userdata# ls -la
total 2036
drwxrwxrwx 3 1001 1001   4096 Apr  4 12:42 .
drwxrwxrwx 1 1001 1001   4096 Apr  4 12:42 ..
-rwxrwxrwx 1 1001 1001   2991 Apr  4 12:43 OZW_Log.txt
-rwxrwxrwx 1 1001 1001 978944 Apr  4 12:42 domoticz.db
-rwxrwxrwx 1 1001 1001  32768 Apr  4 12:43 domoticz.db-shm
-rwxrwxrwx 1 1001 1001 523272 Apr  4 12:44 domoticz.db-wal
-rwxrwxrwx 1 1001 1001 525671 Apr  4 12:43 ozwcache_0xfacac939.xml
drwxrwxrwx 2 1001 1001   4096 Apr  4 12:13 plugins
-rwxrwxrwx 1 root root    108 Apr  4 12:42 zwscene.xml
root@545adcf36101:/opt/domoticz/userdata#
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Oficial Docker Container

Post by Gravityz »

you get the write errors because the directory path does not exist outside the docker image.

i see that you have mapped /opt/docker/userdata to ./config

this means that everything probably appears in /docker/domoticz/config(not sure because you have a pi)

if you create these directories on your synology the write errors are gone
/volume1/docker/domoticz/config//scripts/dzVents/generated_scripts
/volume1/docker/domoticz/config//scripts/dzVents/scripts

i have opt/docker/userdata mapped to docker/domoticz

this way everything appears under the domoticz directory instead of the config directory
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Oficial Docker Container

Post by pvklink »

Hi, my docker (with docker-compose) works great! even the volumes outside domoticz and the hardware
Last part is to get https working, http works OK!
I tried to https://192.168.20.38:1443 but no luck
Do i have to change other files to get connected ?
In my non-container environment i had a pem file in the root....

domoticz:
container_name: domoticz
#build: ./services/domoticz/.
image: domoticz/domoticz:latest
ports:
- "82:8080"
- "6144:6144"
- "1443:1443"
- "9000:9000"
devices:
- '/dev/ttyUSB0:/dev/ttyUSB0'
volumes:
- ./volumes/domoticz/data:/opt/domoticz/userdata
restart: unless-stopped
network_mode: bridge
environment:
- PUID=1000
- PGID=1000
- LOG_PATH=/opt/domoticz/userdata/domoticz.log
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Oficial Docker Container

Post by pvklink »

It works!
i added - "444:443" to the compose file
and copied the old pem file to .volumes/domoticz/data/keys
and changed the file .volumes/domoticz/data/scripts/domoticz.conf
--> ssl_cert=/opt/domoticz/keys/server_cert.pem
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Oficial Docker Container

Post by pvklink »

i Have all dockers ready for my RPI accept the broadlink plugin.
Anyone that part ready?
I have a first trial , that gives no errors, but does not work...
Options for this plugin:
- as a extended part of domoticz container or
- as a isolated plugin in a python docker (need only the port 9000 option and http coupling)

Working dockers with one docker-compose file and some dockerfiles and scripts
- apache, php
- motion
- motion-eye
- domoticz
- dashticz
- node-red
- mosquitto
- mysql
- phpadmin

attached media / volumes
- usb stick
- nas file share

and most config files/data not in the container but outside...

docker-compose domoticz part

Code: Select all

   container_name: domoticz
    build: ./services/domoticz/.
    #image: domoticz/domoticz:latest
    ports:
    - "82:8080"
    - "444:443"
    #originele pem file gekopieerd in keys folder en changed ssl_cert=/opt/domoticz/keys/server_cert.pem in /volumes/domoticz/data/scripts/domoticz.conf
    - "6144:6144"
    - "9000:9000"
    devices:
    - '/dev/ttyUSB0:/dev/ttyUSB0'
    volumes:
    - ./volumes/domoticz/data:/opt/domoticz/userdata
    restart: unless-stopped
    network_mode: bridge
    environment:
    - PUID=1000
    - PGID=1000
    - LOG_PATH=/opt/domoticz/userdata/domoticz.log

dockerfile for domoticz with non-working scripting for broadlink plugin

Code: Select all

FROM domoticz/domoticz:latest
USER root

RUN apt-get update 
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y -q build-essential\
		     wget \
		     zip \
		     unzip \
		     git \
                     python3-pip \
		     python3.7 \ 
	             python3-lxml \
 		     libpython3.7/*

RUN python3 -m pip install -U pip
RUN python3 -m pip install setuptools
RUN python3 -m pip install wheel
RUN pip3 install --upgrade setuptools
RUN python3 -m pip install googletrans
RUN python3 -m pip install translate
RUN python3 -m pip install requests
RUN python3 -m pip install requests_toolbelt
RUN python3 -m pip install irgen
#RUN pip3 install broadlink

#VOLUME ["/opt/domoticz/scripts", "/opt/domoticz/backups",  "/opt/domoticz/db", "/opt/domoticz/plugins", " /opt/domoticz/www/images/floorplans", " /opt/domoticz/www/templates"]
EXPOSE 8080 9440 9000 

RUN mkdir -p /opt/domoticz/plugins 
RUN cd /opt/domoticz/plugins && wget http://192.168.20.48:80/downloads/broadlink.zip && unzip -q broadlink.zip && rm broadlink.zip

# trials
# RUN python3 -m pip install python-broadlink-master
# RUN python3 -m pip install /opt/domoticz/plugins/Broadlink/python-broadlink-master/setup.py
# Could not install packages due to an EnvironmentError: 404 Client Error: Not Found for url: https://pypi.org/simple/python-broadlink-master/

RUN chmod -R 777 /opt/domoticz/plugins/Broadlink

# only one CMD ?
#CMD [ "python3", "/opt/domoticz/plugins/Broadlink/python-broadlink-master/setup.py" ]
#CMD [ "python3", "/opt/domoticz/plugins/Broadlink/setup.py" ]

CMD ["/opt/domoticz/domoticz"]


Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
knireis
Posts: 16
Joined: Wednesday 09 April 2014 14:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post by knireis »

I run the domoticz docker on my QNAP and it runs fine. There is however one thing i can't seem te resolve. The docker will not autostart after a restart of the QNAP nas. I think the cause is that the device (RFXCOM) is not ready yet at the qnap when the docker is starting up.
I use the device option to connect /dev/ttyUSB0 from the host to the docker.
I have asked this question before in a qnap forum but no solution yet. Is it possible to delay the usb passthrough of the device to the docker? Maybe delay the start of the domoticz docker?
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: Oficial Docker Container

Post by Chris12 »

Some questions about the domoticz docker:

How can I create my own docker after installing some extra packages like:
- apt update
- apt install curl
- apt install python
- apt install python-requests
- apt-get install sudo
- apt-get install openssh-server
All needed for getting my scripts working.

How can I check for updates of domoticz?
I now run version 2021.1 (build 13243), will there be a pop-up notifiying me when a new version is available? Or is that a complete new docker image?
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest