Skip to content

Commit

Permalink
Merge pull request #189 from codedge/master
Browse files Browse the repository at this point in the history
Add cronjob for IN 5
  • Loading branch information
codedge authored Aug 18, 2020
2 parents c30cae4 + 3348a2b commit 994d75a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions alpine/Dockerfile_v5
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 3 additions & 0 deletions config/cron/cronjob_v5.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env sh

cd /var/www/app; php artisan schedule:run >> /dev/null 2>&1
4 changes: 4 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ file_env() {
unset "$fileVar"
}


# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- php-fpm "$@"
Expand Down Expand Up @@ -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 "$@"

0 comments on commit 994d75a

Please sign in to comment.