Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FEAT: add crontab to the docker image, setup default cron jobs. #92

Open
bpinsard opened this issue Oct 9, 2024 · 4 comments
Open

FEAT: add crontab to the docker image, setup default cron jobs. #92

bpinsard opened this issue Oct 9, 2024 · 4 comments
Assignees

Comments

@bpinsard
Copy link

bpinsard commented Oct 9, 2024

Allo!

I think the docker image could package cron and crontab to allow scheduling the jobs here.
https://github.com/LibreBooking/app/tree/develop/Jobs
Setting up the crontab by default for these tasks could be done in the Dockerfile.

Cheers

@colisee
Copy link
Collaborator

colisee commented Oct 12, 2024

Hi @bpinsard ,

Thank you very much for your proposal.

How about letting the host (ie. the server running the docker container) take care of the periodic tasks like the librebooking jobs through its own cron or systemd timer mechanism?

This way:

  1. the host would periodically run a command like docker exec --detach <container_name> php -f /var/www/html/Jobs/sendreminders.php
  2. we would keep the docker image as small as possible

What do you think?

@bpinsard
Copy link
Author

Thanks for the rapid feedback.
I think the goal of containers is to package a software and all it's features into one thing. This avoids having to do separate setup to access these features and thus ease deployment. I will check how much the cron package makes the image bigger and get back to you with numbers.

@colisee
Copy link
Collaborator

colisee commented Oct 13, 2024

Bonjour @bpinsard ,
Developers have different views on what a container should include: some (like me) prefer to have a container focusing on one task and other to have a container doing everything.

Having said that, I understand that it could be easier to control recurrent jobs within the container instead of controlling them from the host. I will review your changes and maybe propose some changes in order to offer more flexibility (not everyone want to run recurrent jobs and some might run other available jobs you didn’t include).

A bientôt.

@colisee
Copy link
Collaborator

colisee commented Oct 14, 2024

Bonjour @bpinsard

I reviewed your changes.
The crontab file should not be recorded inside the librebooking image, but mapped at run time through the --volume argument (I will need to change the documentation once your changes are merged)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants