3liz / lizmap-docker-compose

Run Lizmap stack with docker-compose
31 stars 42 forks source link

Is it possible to use custom templates in Lizmap-Docker? #25

Open skvo1977 opened 2 years ago

skvo1977 commented 2 years ago

Hello!

I'm using Lizmap 3.5 with Docker on Ubuntu Server 20.04. And I have a question

Сan i use custom templates as described in documentation here ? - https://docs.lizmap.com/current/en/publish/customization/template.html And where should the template files be placed in this case? Do I need to add a folder "var/themes/default" in section "volumes" for "lizmap"- servieces in docker-compose file?

Thanks you.

nboisteault commented 2 years ago

Hi! Yes, please try to add - ${LIZMAP_DIR}/var/lizmap-themes-default:/www/lizmap/var/themes/default after : https://github.com/3liz/lizmap-docker-compose/blob/master/docker-compose.yml#L17

And tell us if it works. If it is ok, could you please make a Pull Request?

skvo1977 commented 2 years ago

Thank you very much! It works. I'll try to make a pull request, but this will be my first time. So sorry if this isn't quite correct. :)

skvo1977 commented 2 years ago

I'm sorry. I reopen this topic because I find error in the work of the administration interface after changes. My changes: I change docker-compose.yml - add new line ${LIZMAP_DIR}/var/lizmap-themes-default:/www/lizmap/var/themes/default Copy only modified template main.tpl in ${LIZMAP_DIR}/var/lizmap-themes-default/view The map view interface work correct.
But, when I go to administration interface I have this error "Error 500. A technical error has occured. Sorry for this trouble." er2 The login form have this view: er1

In log-files in /lizmap/www/var/log/errors.log I see "2022-06-16 14:51:11 10.0.2.2 error 2022-06-16 14:51:11 [18] Unknown module in the selector "jauth~login:out@classic" /www/lib/jelix/core/selector/jSelectorAct.class.php 70"

In log-files in /lizmap/var/log/nginx/lizmap_access.log _10.0.2.2 - - [16/Jun/2022:12:51:11 +0000] "GET /admin.php/admin/config/?auth_url_return=%2Fadmin.php%2Fadmin%2Fconfig%2F HTTP/1.1" 500 178 "http://192.168.2.67:8090/admin.php/auth/login/?auth_url_return=%2Fadmin.php%2Fadmin%2Fconfig%2F%3Fauth_url_return%3D%252Fadmin.php%252Fadmin%252Fconfig%252F" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.0.0 Safari/537.36"_

If I delete line about lizmap-themes-default in docker-compose.yml - all work correct.

dmarteau commented 2 years ago

It appears that there is some content needed in the directory required for lizmap to run properly. (Lizmap is not fully docker friendly yet :-/).

My guess is that you will have to modify the docker-compose file to fit your needs: i.e explicitely mount the files/dir required for your needs.

skvo1977 commented 2 years ago

Thank you. I found what files were needed for the administration interface. Everything is working correctly now :)

nboisteault commented 2 years ago

@skvo1977 Could you change your PR accordingly? Thanks.

toniodlab commented 2 years ago

Hello there. I find why this issue is triggered.

Adding the following line will erase some content in lizmap/var/themes/default folder : - ${LIZMAP_DIR}/var/lizmap-themes-default:/www/lizmap/var/themes/default

I instead added this line - ${LIZMAP_DIR}/var/lizmap-themes-default/view:/www/lizmap/var/themes/default/view and everything is working fine.

I may need to add a line for every modules I want to rewrite, but it's not a problem for me.

If you have a better solution I'll take it :)

laurentj commented 1 year ago

With the image of Lizmap 3.6 and higher, there is no more static files into lizmap/var, so you can mount /www/lizmap/var/themes/default.