Closed TheGrumpyBadger closed 1 year ago
Can you provide an example?
Cron will never run the container as it does not run a system supervisor, but I'll bet that the cron tasked are leveraged via commands, so you could use the cron daemon from the host OS like this:
10 23 * * * docker exec kimai /opt/project/bin/console kimai:somecommand
Our crontab on a VM:
50 23 1-5 /var/www/kimai2/bin/console hasworked:sendmails 59 23 10 /var/www/kimai2/var/plugins/kimai-export.sh 49 23 * /var/www/kimai2/bin/console kimai:timesheet:stop-all >> /dev/null
On a docker-swarm we have no dedicated host to run docker exec on, so I like to start a second kimai container with the entrypoint 'cron -f'
Hmm, interesting. We won't build cron into the base image. It's a small as we can make it. Especially the fpm/alpine one and we get requests to just add xxxx frequently. We'd end up shipping a desktop image.
But you could easily roll your own.
FROM kimai/kimai2:XXXX
RUN apt update && apt install -y cron
ENTRYPOINT /usr/sbin/cron -f
please add installation of the package cron to the Dockerfile.
Reason: