Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit 54bfb1e

Browse files
committed
add custom cron file to nextcloud image
1 parent 28dfc38 commit 54bfb1e

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

nextcloud/Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ RUN ln -sf /opt/config/nginx.conf /etc/nginx/sites-enabled/default; \
7575
RUN chown www-data /opt/config
7676

7777
ADD start.sh /usr/local/bin/run
78+
ADD cron.sh /usr/local/bin/cron.sh
7879
VOLUME /opt/storage /opt/config /opt/log /opt/static
7980
EXPOSE 9787/tcp
8081
ENTRYPOINT /usr/local/bin/run

nextcloud/cron.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env sh
2+
set -e
3+
4+
echo "Preparing environment"
5+
cp /opt/config/config.php /var/www/nextcloud/config/config.php
6+
chown -R www-data /var/www/nextcloud/config /var/www/nextcloud/apps /opt/log
7+
chmod +x ./occ
8+
mkdir -p /run/php
9+
export USER=www-data HOME=/home/www-data
10+
11+
echo "Syncing system address books with dav"
12+
su -s /var/www/nextcloud/occ www-data dav:sync-system-addressbook
13+
14+
echo "Running cron.php"
15+
su -s /usr/bin/php www-data /var/www/nextcloud/cron.php
16+

0 commit comments

Comments
 (0)