Skip to content

Commit

Permalink
add custom cron file to nextcloud image
Browse files Browse the repository at this point in the history
  • Loading branch information
lilioid committed Oct 4, 2024
1 parent 28dfc38 commit f7e0a3e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions nextcloud/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
13 changes: 13 additions & 0 deletions nextcloud/cron.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env sh
set -e

echo "Preparing environment"
cd /var/www/nextcloud
chmod +x ./occ

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

0 comments on commit f7e0a3e

Please sign in to comment.