diff --git a/nextcloud/Dockerfile b/nextcloud/Dockerfile index 635b9ce..a850ddb 100644 --- a/nextcloud/Dockerfile +++ b/nextcloud/Dockerfile @@ -75,6 +75,7 @@ RUN ln -sf /opt/config/nginx.conf /etc/nginx/sites-enabled/default; \ RUN chown www-data /opt/config ADD start.sh /usr/local/bin/run +ADD cron.sh /usr/local/bin/cron.sh VOLUME /opt/storage /opt/config /opt/log /opt/static EXPOSE 9787/tcp ENTRYPOINT /usr/local/bin/run diff --git a/nextcloud/cron.sh b/nextcloud/cron.sh new file mode 100755 index 0000000..47cff09 --- /dev/null +++ b/nextcloud/cron.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env sh +set -e + +echo "Preparing environment" +cp /opt/config/config.php /var/www/nextcloud/config/config.php +chown -R www-data /var/www/nextcloud/config /var/www/nextcloud/apps /opt/log +chmod +x ./occ +mkdir -p /run/php +export USER=www-data HOME=/home/www-data + +echo "Syncing system address books with dav" +su -s /var/www/nextcloud/occ www-data dav:sync-system-addressbook + +echo "Running cron.php" +su -s /usr/bin/php www-data /var/www/nextcloud/cron.php +