How can i set up Nextcloud in a resillient way

im struggling to get nextcloud set up in a resilient manner that dosent break when the image is updated or the docker container restarted at an inconvenient time. ive set up nextcloud about 4 times now, twice i had issues with the docker container getting updated at a bad time and nextcloud just didnt want to run again. after that i seperated it from my services stack and made a stack just for nextcloud but ive been unable to update the docker image manually or automatically with watchtowerrr. no matter what i do Nextcloud feels unstable. the configs are mounted externally, im not using a local db, so if nextcloud does go down, it shouldnt sh*t itself. it should pick back up from the mounted configs. i dont know whats breaking nextcloud, and i really need help with it.

here is my current nextcloud compose config

version: "3.9"
    container_name: nextcloud
    image: nextcloud
      - ${APP_VOLUME}/config/nextcloud:/var/www/html/config
      - ${APP_VOLUME}/data/nextcloud:/var/www/html
    restart: unless-stopped

    container_name: nextcloud_mariadb
    image: mariadb:latest

    container_name: nextcloud_tunnel
    image: cloudflare/cloudflared:latest 
    command: tunnel --no-autoupdate run --token ${CLOUDFLARED_TOKEN}

as you can see, teh config mounts the config to an external volume. there should be no issue with data or configs or anything, but im still facing issues with nextcloud whenever the container gets updated or goes down at an inconvenient time.

this is an issue with you upgrade process, I have no experience with watchtower but I would expect such solution can define working hours so upgrades don’t break the system while users actively work with it.

Please don’t open multiple threads for the same topic:

same recommendation: please review the proper upgrade procedure.

Resilience and auto-update don’t mix. I take a VM snapshot before every manual upgrade and hold it for a couple days, as well as take a nightly backup.

To date, since around Nextcloud 16, I think I’ve only had one update break, and that was due to a default change in redis.