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 54bfb1e
Show file tree
Hide file tree
Showing 2 changed files with 17 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
16 changes: 16 additions & 0 deletions nextcloud/cron.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 54bfb1e

Please sign in to comment.