My sync clients always loose their session whenever docker container is restarted

I am running Nextcloud (currently v21) using docker-compose on a Ubuntu 20.04 server. This works well with one exception: Whenever I have to restart my container (during an update), the sessions of all of my sync clients get deleted meaning I have to reconnect them which is very tedious.
I am using the nextcloud desktop client (v2.6.2) on Ubuntu 20.04 as well as the official Android client installed via F-Droid (v3.18.0).
I have been using app-passwords for the mobile client and logged in via a browser session on the desktop.

My docker-compose file is looking like this:

version: '2'

services:
  db:
    image: mariadb:10.5
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW --innodb-force-recovery=0 --innodb-force-recovery=0
    restart: always
    volumes:
      - /srv/docker/nextcloud/mysql:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=foo
      - MYSQL_PASSWORD=bar
      - MYSQL_DATABASE=nextcloud
      - MYSQL_USER=nextcloud
      - FUTURE_OPT=--innodb_read_only_compressed=0

  app:
    image: nextcloud:21
    ports:
      - 8090:80
    links:
      - db
    volumes:
      - /srv/docker/nextcloud/html:/var/www/html

This issue is not bound to the versions I am currently using, it has rather been present since I started using Nextcloud.

What can I do to persist my syn client’s session over an upgrade?

[/details]

Nextcloud version : 21
Operating system and version : Ubuntu 20.04