Nextcloud Docker Container - best way to run cron job
I have been doing some test setups of running NextCloud in a docker container. One thing I am still a little confused on and would like to hear your thoughts about, is running the cron process. I am a little surprised that it is not the default, but I found two methods of running the cron job in a container.
The first is from Docker Hub NextCloud examples (docker/.examples at master · nextcloud/docker · GitHub). It “uses supervisor to run the cron job inside the container (so no extra container is needed). This image runs supervisord to start nextcloud and cron as two seperate processes inside the container.” This requires a custom image build (docker/Dockerfile at master · nextcloud/docker · GitHub). Other than that it is not complicated.
My questions are:
What is the best way to run the cron job? (in regards to efficiency, ease of backups and restores, etc)
Is one an older way and the examples have just not been updated yet?
Please use the search - lot of issues have been discussed already like
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 :