wwe
March 13, 2023, 9:12pm
2
hello @John2 welcome back in the forum
Please use the search - lot of issues have been discussed already like
Hello
I’m running my nextclud instance via docker (compose file adopted from here ). There is already a container running /cron.sh, which starts a busybox with cron, which starts cron.php every 5 minutes.
Now my question is: how to do i add additional tasks? (i.e. ./occ fulltextsearch:index)
I do not want to rebuild the nextcloud image just for adding a cron task. And i do not want to use the host for managing tasks in the container (host systemd oder host cron)
any way to manage this?
Greet…
Hi guys,
Host: proxmox
VM: Ubuntu server 18.04.5 LTS.
Nextcloud: 20.0.4
Everything updated
I run Nginx Proxy Manager as my reverse proxy also in a separate container.
I installed Nextcloud via the docker-compose example but I customized it of course… insecure/mariadb-cron-redis/apache/docker-compose.yml
My docker-compose file:
version: '3'
services:
db:
image: mariadb
command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
restart: always
volumes:
- .…
there are multiple ways to run cron with docker. I think most common way is to setup another separate “cron” container using same image volume mounts, config and env variables as “app” with different entrypoint :
dev-nextcloud-cron:
image: nextcloud:${NEXTCLOUD_VERSION}
container_name: dev-nextcloud-cron
restart: unless-stopped
env_file:
- ./nextcloud.env
- ./db.env
volumes:
- ./app:/var/www/html
- ./files:/var/www/html/data
- ./config:/var/www/html/config
entrypoint: /cron.sh
depends_on:
- dev-nextcloud-app