Nextcloud Docker Container - best way to run cron job

hello @John2 welcome back in the forum :handshake:

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 :

  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