diff --git a/alpine/Dockerfile_v5 b/alpine/Dockerfile_v5 index f44bc39..1ec0bd9 100644 --- a/alpine/Dockerfile_v5 +++ b/alpine/Dockerfile_v5 @@ -67,6 +67,10 @@ RUN set -eux; \ COPY ./config/php/php.ini /usr/local/etc/php/php.ini COPY ./config/php/php-cli.ini /usr/local/etc/php/php-cli.ini +## Set up the cronjob +RUN echo "* * * * * run-parts /etc/periodic/1min" >> /etc/crontabs/root +COPY ./config/cron/cronjob_v5.sh /etc/periodic/1min/invoiceninja_cronjob + ## Separate user ENV INVOICENINJA_USER=invoiceninja diff --git a/config/cron/cronjob_v5.sh b/config/cron/cronjob_v5.sh new file mode 100644 index 0000000..d14354a --- /dev/null +++ b/config/cron/cronjob_v5.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env sh + +cd /var/www/app; php artisan schedule:run >> /dev/null 2>&1 diff --git a/entrypoint.sh b/entrypoint.sh index 16e9dd0..edee989 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -41,6 +41,7 @@ file_env() { unset "$fileVar" } + # first arg is `-f` or `--some-option` if [ "${1#-}" != "$1" ]; then set -- php-fpm "$@" @@ -100,4 +101,7 @@ file_env 'S3_SECRET' php artisan config:cache php artisan optimize +# Start the cron daemon in background +crond -l 2 -b + exec docker-php-entrypoint "$@"