mirror of
https://github.com/invoiceninja/dockerfiles.git
synced 2026-01-07 15:07:27 +01:00
Fixes for crons and folder permissions
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user