dpfaffenbauer/pimcore-docker

Pimcore maintenance cron job support request

haapakanni opened this issue · 5 comments

To follow documentation

https://pimcore.com/docs/5.x/Development_Documentation/Getting_Started/Installation.html#page_5-Maintenance-Cron-Job

pimcore docker image should create cron job in Dockerfile to support the maintenance feature

RUN echo "*/5 * * * * www-data <path to pimcore root dir>/bin/console maintenance" >> /etc/crontab

and start the cron

CMD service cron start && apachectl -D FOREGROUND

so that UI wouldn't complain "It seems that the maintanance isn't set up properly" as follows

pimcore-missing-maintenance-cron-job

Perhaps adding systemd to get cron autostarted would be bulletproof solution.

Would be, but solving this is not intended by these docker images, since it is very setup specific. Some would do it in the same container, others would use a separate one.

@dpfaffenbauer I wouldn't call this as project specific task since every installation of pimcore is and will complain and interfere both developers and users about the task forgotten by the sysadmin aka docker image composer. As there is cron already bundled in the docker image and the task runs pimcore console I wouldn't run the task in separate container.

@dpfaffenbauer

Keep in mind, that the cron job has to run as the same user as the web interface to avoid permission issues (eg. www-data). - https://pimcore.com/docs/5.x/Development_Documentation/Getting_Started/Installation.html#page_5-Maintenance-Cron-Job

May also cause some problems if trying to run the task via separate container

Jep, that is Setup specific.

Still: my containers are not intended to have cron built in. If you need it, you can create your own containers