Fixes for crons and folder permissions

This commit is contained in:
David Bomba
2021-01-03 21:34:04 +11:00
parent 32c93eb4d7
commit a82d60b4f5
2 changed files with 19 additions and 6 deletions

View File

@@ -96,15 +96,10 @@ RUN addgroup -S "$INVOICENINJA_USER" && \
addgroup "$INVOICENINJA_USER" www-data; \
chown -R "$INVOICENINJA_USER":"$INVOICENINJA_USER" /var/www/app
# Install Composer
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer;
## 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 /usr/local/bin/composer install --no-dev --no-suggest --no-progress --quiet

View File

@@ -71,6 +71,24 @@ services:
networks:
- invoiceninja
# V5 crons only
cron:
image: invoiceninja/invoiceninja:5
volumes:
- public:/var/www/app/public
- storage:/var/www/app/storage
entrypoint: |
/bin/sh -c 'sh -s <<EOF
trap "break;exit" SIGHUP SIGINT SIGTERM
sleep 60s
while /bin/true; do
./artisan schedule:run >> /dev/null 2>&1
sleep 60s
done
EOF'
networks:
- invoiceninja
# THIS IS ONLY A VALID CONFIGURATION FOR IN 4. DO NOT USE FOR IN 5.
# cron:
# image: invoiceninja/invoiceninja:alpine-4