From afcd9389edde5311d05d07ec4329ce68dbd8fd21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Holger=20Lo=CC=88sken?= Date: Wed, 19 Aug 2020 10:41:40 +0200 Subject: [PATCH] Fix execution of cron daemon --- alpine/Dockerfile_v5 | 12 +++++++----- config/cron/cronjob_v5.sh | 0 entrypoint.sh | 3 --- 3 files changed, 7 insertions(+), 8 deletions(-) mode change 100644 => 100755 config/cron/cronjob_v5.sh diff --git a/alpine/Dockerfile_v5 b/alpine/Dockerfile_v5 index 1ec0bd9..0e54ae5 100644 --- a/alpine/Dockerfile_v5 +++ b/alpine/Dockerfile_v5 @@ -67,10 +67,6 @@ 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 @@ -89,9 +85,15 @@ RUN addgroup -S "$INVOICENINJA_USER" && \ RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer; \ composer global require hirak/prestissimo; +## Set up the cronjob and run cron daemon +RUN echo "* * * * * run-parts /etc/periodic/1min" >> /etc/crontabs/root +COPY ./config/cron/cronjob_v5.sh /etc/periodic/1min/invoiceninja_cronjob +RUN chown $INVOICENINJA_USER /etc/periodic/1min/invoiceninja_cronjob && \ + crond -l 2 -b + USER $INVOICENINJA_USER -RUN composer install --no-dev --no-suggest --no-progress +RUN composer install --no-dev --no-suggest --no-progress --quiet # Override the environment settings from projects .env file ENV APP_ENV production diff --git a/config/cron/cronjob_v5.sh b/config/cron/cronjob_v5.sh old mode 100644 new mode 100755 diff --git a/entrypoint.sh b/entrypoint.sh index edee989..7241aff 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -101,7 +101,4 @@ 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 "$@"