LibreBooking / docker

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

Simplified deployment #35

Closed Jacq closed 1 year ago

Jacq commented 1 year ago

Currently the full application (code+data) folders are suggested to be mounted externally using the reference docker-compose.yml file. The app currently only has user data in config/ (some plugins config folders), uploads/, Web/uploads and Web/images. This could also be improved in the librebooking source project by unifying these folders into a single /data folder.

The deployment and maintenance could be simplified if only data volumes need to be mounted externally instead of the full /var/www/html folder, the copy of the full code could be avoided that will also simplify upgrades. The Dockerfile could include the compose install dependencies and application code internally. A good reference for this aproach is the one in the project snipeit https://github.com/snipe/snipe-it/blob/master/Dockerfile

What do you think? Cheers!,

colisee commented 1 year ago

Hi @Jacq

thank you for your interest in the project and for your suggestion.

Actually, I was considering merging part of the entrypoint.sh code inside the Dockerfile and install the whole application directly inside /var/www/html folder. The only object to stay outside the container would be the config.php file. This file is the only object needed when doing a Librebooking upgrade.

I need to make a few tests to test the concept. I will nevertheless look at the snipe-it repository to better understand their approach.

Cheers.

colisee commented 1 year ago

Hi @Jacq

Could you please have a look at the branch issue30 inside my fork (github.com/colisee/librebooking-docker) and give me your feed-back?

I made several changes to the Dockerfile and entrypoint.sh and I updated the documentation files SETUP.md and RUN.md.

In a nutshell, the volume previously named librebooking_html is now replaced by a volume named librebooking_conf that only holds the configuration file config.php. This volume is mapped to the folder /config inside the image.

Cheers.

Jacq commented 1 year ago

Hi @colisee

I tested the new version and it looks good. However the configuration via env vars and setup for the new docker is not very intuitive as the main librebooking/app repository has already a docker-compose.yml that cannot be used with this image and some env vars that should be used with this new version.

I have created a similar docker-compose.yml (and additiona .env file) to test this new version and make explicit the recommended configuration for the config folder and possibly for the log folder. I have just created a pull request for you to have a look.

Would not be easy to maintain to include this docker repo code into the main repo and use it for development and image production?