moodlehq / moodle-php-apache

PHP + Apache docker images for Moodle development

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to Provide Moodle Cron?

andisugandi opened this issue · comments

I could not find the Moodle Cron when using the container image: moodlehq/moodle-php-apache.

$ crontab -l
bash: crontab: command not found

Should we make it by customizing the Dockerfile?

Any suggestions?

Thank you in advance.

Hi @andisugandi ,

while it's possible to add cron support to the images / containers, it's not considered good practice. Problems can arrive, specially in prod environments with forked processes dying and not being monitored by the engine...

So, the recommendation is to create another image, specialised into running cron (or any other scheduling alternative).

Basically, "Each container, one task" (process).

Surely you will find out there various ways to achieve that, from the host own crontab being in charge to "exec" the cron in the container, to other containers launching cron via web request against the apache/moodle container... or a complete stack with access to the codebase, database and moodledata and running the cron locally.

I'm going to close this now, ciao :-)