LibreBooking / docker

Librebooking as a docker container
GNU General Public License v3.0
11 stars 9 forks source link

How to mount /var/www/html entirely ? #57

Closed VitorTakami closed 12 months ago

VitorTakami commented 1 year ago

Hi, guys. I need to mount /var/www/html container to my host folder, is there a way to do that ? I appreciate you help. Thanks.

colisee commented 1 year ago

Hi @VitorTakami,

Is there any reason why you need to mount your container /var/www/html folder to your host?

Normally that folder contains the application objects…

VitorTakami commented 1 year ago

Hello, Colisee, how are you ? Currently i'am working at Public University, and we are using librebooking. This app is important to us. The main issues about librebooking volume is for the customization, for example, ldap, logos, imgs, and we need the updated php for security issues (8.0.29 are vulnerable). I'am considering migrating it to docker for simple management and in the future i want create a kubernetes cluster, because this application is important to us. I'm building the container and trying to change the volume folder, but if is possible to generate one version with that i will appreciate. Thanks.

colisee commented 1 year ago

Hi @VitorTakami ,

I am fine, thank you and I trust it is the same for you.

If your intention is to customize some application objects, like logos and images, then I would just override/mount the specific files. If you override/mount the whole /var/www/html folder, then it would be quite tedious for you to keep up with the future docker image versions.

For instance, let's assume you are using a docker-compose.yml file and you want to override the librebooking logo with your-university logo. In that case, you could:

  1. Copy your university logo file in the same folder containing the docker-compose.yml file
  2. Change your docker-compose.yml file
     volumes:
       - vol-app:/config
       - ./university-logo.png:/var/www/html/Web/img/librebooking.png

I also noted that you mentioned using ldap. Please track issue #58 since the latest docker image does not implement ldap yet. I think I should be able to fix this in the coming days.

Finally, regarding the php version used in the docker image, the latest docker image is using php:8.2.7

VitorTakami commented 1 year ago

Hello, Robin Alexander, how are you ? I tried to mount /var/www/html, but it returned an error. I need to access various contents within this folder, including the plugins. I have attached the errors for reference. librebooking

colisee commented 1 year ago

Hi @VitorTakami ,

As I wrote before, you are not supposed to mount a host folder to your container /var/www/html folder. Please refer to the documentation

Instead, could you give me the list of the files that you wish to customize inside /var/www/html ?

VitorTakami commented 1 year ago

I @colisee, but in the following versions, will be possible to mount /var/www/html ? I ask, because there is a lot of files that i need to setup, for example, i need almost all plugins of folder plugins.

colisee commented 1 year ago

No, I do not plan to create a volume definition for /var/www/html inside the image. This used to be the case in version-1 of the docker image but I changed this approach with version-2 of the docker image.

May I ask you why you need to customize all the plug-in files? If you do so, it will become more difficult for you to keep up with future new versions of Librebooking…

Now, if you nevertheless insist on customizing all the files, then you need to add the following line to the volumes section of the docker-compose.yml file:

where /opt/lb-config is an empty folder on your host.

VitorTakami commented 1 year ago

Good Morning @colisee . I'm search for all the files that i need to expose on the host, but i think that will be only ldap files, therefore plugins/ldap folder entirely, somo logos and one customize script. Therefore, i have some questions:

I will appreciate your help. Thanks.

colisee commented 1 year ago

Hi @VitorTakami ,

I did not forget you!

I did some research and for the time being, it is not possible to use ldap with librebooking version 2.8.6, since it relies on php 8 which broke the PEAR package Net_LDAP2. A pull request was issued but was not merged yet.

At this stage, you should try to use the very old docker image librebooking/librebooking:2.8.5.5-1.2.3. This image:

Please, monitor issue #58, as I will post test instructions to install the php ldap extension inside the container.

VitorTakami commented 1 year ago

Hello, @colisee . Thank you for the response. However, I cannot use versions lower than PHP 8.0.29 due to security vulnerabilities, and I need to authenticate with LDAP and have some specific mount points for the container. I hope there is a solution for this; however, I will wait. Thank you for the assistance.

colisee commented 1 year ago

Hi @VitorTakami and @effgarces ,

The LDAP plugin must be fixed on the upstream repository first. Then I can change the dockerfile and publish a new librebooking/librebooking:2.8.6 image

colisee commented 12 months ago

You can now use the docker image librebooking/librebooking:2.8.6.1

ldap authentication works.

Neustradamus commented 11 months ago

@colisee, @VitorTakami: https://github.com/pear/Net_LDAP2/pull/13 has been merged and it has been added in Net_LDAP2 2.3.0.