Page 1 of 1
Custom Icons and themes in Docker
Posted: Thursday 04 January 2024 19:17
by solarboy
I am experimenting with moving over to Docker following the guide here
https://www.domoticz.com/wiki/Docker
I have it up and running and have managed to upload my old database using the built in function and I have copied over my "Scripts" and "Plugins" folders which are now both available in Domoticz.
However I can't seem to work out how to transfer my custom icons over (and have them available if the container updates).
Is this possible ?
Re: Custom Icons and themes in Docker
Posted: Thursday 04 January 2024 19:23
by waltervl
As mentioned in your other posting you should have a userdata folder.
Re: Custom Icons and themes in Docker
Posted: Thursday 04 January 2024 20:11
by solarboy
waltervl wrote: ↑Thursday 04 January 2024 19:23
As mentioned in your other posting you should have a userdata folder.
I have no userdata folder in the Docker folder (/opt/domoticz) or in my old install directory on RpiOS. Should I create one and where do I pull the themes and icon files from ?
There is a folder called "www" that appears to have themes folders and images in it but this does not exist in the Docker folder.
Re: Custom Icons and themes in Docker
Posted: Thursday 04 January 2024 20:19
by solarboy
A config folder was created and within that a "Plugins" folder and a "Scripts" folder and a "Config" folder were created, but no "userdata" folder.
Re: Custom Icons and themes in Docker
Posted: Thursday 04 January 2024 21:34
by solarboy
Code: Select all
root@domoticz2:/opt/domoticz/config# ls
domocookie.txt domoticz.db domoticz.db-shm domoticz.db-wal plugins scripts
root@domoticz2:/opt/domoticz/config#
Code: Select all
root@domoticz2:/opt/domoticz# ls
config docker-compose.yml
Either my Docker container wasn't correctly created or there is some missing information.
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 12:16
by rron
Same with me no user data folder, in the docker compose there’s a rule with /opt/domoticz/userdata.
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 12:20
by Kedi
The /opt/domoticz/userdata is internal in the container and should be external in the config folder.
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 12:28
by solarboy
Kedi wrote: ↑Friday 05 January 2024 12:20
The /opt/domoticz/userdata is internal in the container and should be external in the config folder.
So I should manually create within the external config folder a new folder called userdata ( /opt/domoticz/config/userdata/ ) and this will be mirrored within the container as /op/domoticz/userdata ?
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 12:49
by Kedi
No!
In the container Domoticz is installed in /opt/domoticz
In that foler in the container is a folder userdata created (by Domoticz) that is exposed to the outside world in the ./config folder.
That ./config folder is below the folder in which the compose file is when you startup the Domoticz container with the compose command.
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 13:09
by solarboy
Thanks for that. Domoticz did not create a "userdata" folder in my "Config" folder on the host system.
Code: Select all
admin@domoticz2:/opt/domoticz/config $ ls
domocookie.txt domoticz.db-shm domoticz.log scripts
domoticz.db domoticz.db-wal plugins
Do I create it myself in that case ?
Which files/folders should I copy over to enable my themes/custom icons in the new Docker install ?
Where should I copy them to ?
In the new Docker domoticz, although there is the setting to change theme, it does nothing, is this normal ?
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 13:14
by Kedi
Your setup look good (best to use next time ls -al)
Those other files are in the Domoticz 'www' folder and that is default NOT exposed to the outside world.
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 14:30
by waltervl
solarboy wrote: ↑Friday 05 January 2024 13:09
Thanks for that. Domoticz did not create a "userdata" folder in my "Config" folder on the host system.
Code: Select all
admin@domoticz2:/opt/domoticz/config $ ls
domocookie.txt domoticz.db-shm domoticz.log scripts
domoticz.db domoticz.db-wal plugins
Do I create it myself in that case ?
Which files/folders should I copy over to enable my themes/custom icons in the new Docker install ?
Where should I copy them to ?
In the new Docker domoticz, although there is the setting to change theme, it does nothing, is this normal ?
Do you use the official domoticz docker image or another ( there are more images available)?
https://hub.docker.com/r/domoticz/domoticz
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 14:34
by solarboy
I am following the instructions from this page.
Code: Select all
https://www.domoticz.com/wiki/Docker
My docker-compose.yml currently is
Code: Select all
version: '3.3'
services:
domoticz:
image: domoticz/domoticz:2023.2
container_name: domoticz
restart: unless-stopped
# Pass devices to container
# devices:
# - "/dev/serial/by-id/usb-0658_0200-if00-port0:/dev/ttyACM0"
ports:
- "8080:8080"
volumes:
- ./config:/opt/domoticz/userdata
- /var/sbfspot:/var/sbfspot
- /etc/sbfspot:/etc/sbfspot
environment:
- TZ=Europe/Lisbon
- LOG_PATH=/opt/domoticz/userdata/domoticz.log
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 14:51
by gizmocuz
Custom icons are INSIDE the database, so when you restore your database, these icons are also here.
No need to do anything special.
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 15:44
by solarboy
gizmocuz wrote: ↑Friday 05 January 2024 14:51
Custom icons are INSIDE the database, so when you restore your database, these icons are also here.
No need to do anything special.
Thanks for this, however on restoring my database (which should therefore have the old icons) the icons don't appear in the floorplan etc. If I try to change icons individually the custom icons don't appear on the dropdown list.Themes are also unavailable.
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 16:04
by gizmocuz
Theme's is something else than custom icons.
When you go to the custom icon loader in domoticz, you do not see your custom icons?
That is really odd... they should be there
What happens when you load a new custom icon?
Edit, check also with the default theme
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 16:58
by solarboy
Correct, no Custom Icons there and only default theme available despite the other themes being there.
This was a brand new official docker image that I then "restored" a "backed-up" database into, both being 2023.2 and using the in-built function.
Re: Custom Icons and themes in Docker
Posted: Friday 05 January 2024 17:11
by solarboy
Oh it's solved thank you.
I uploaded a new Icon with the Custom Icon Uploader, the moment I hit "upload" all the other icons appeared in the window and were available for the floor-plans etc etc.
Thanks again ! Now to get the themes going. I tried changing to other themes but it's always the default theme.
Re: Custom Icons and themes in Docker
Posted: Wednesday 17 January 2024 21:34
by kimhav
Based on the default volument mounting,
./config:/opt/domoticz/userdata and I've pulled themse down from Git to themes to
./config/www/styles but neither of the templates (
aurora and
machinon) that I've tried shows up under Settings/Theme option.
Also, beside the above volume, I also have
- ./config/www/templates:/opt/domoticz/www/templates due to custom tab issues (ref. to this
thread) but it might be general fixed so that this volume isn't needed in later releases?
Re: Custom Icons and themes in Docker
Posted: Friday 08 March 2024 22:13
by red59
hello,
same behaviour for me, to get custom icons back after a database restore, i need to do as if i wanted to upload new icons, because they don't appear without this.