dpfaffenbauer / pimcore-docker

Docker PHP Image for Pimcore 5 and 6
23 stars 15 forks source link

Pimcore maintenance cron job support request #22

Closed haapakanni closed 5 years ago

haapakanni commented 5 years ago

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

haapakanni commented 5 years ago

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

dpfaffenbauer commented 5 years ago

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.

haapakanni commented 5 years ago

@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.

haapakanni commented 5 years ago

@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

dpfaffenbauer commented 5 years ago

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