External files changing id on every cron on docker

Hello,

I have a nextcloud instance running on docker, I extended the original nextcloud:apache using the full Dockerfile example. Nothing has been changed on those two files.

I did this so cron could run on the same container as the main Nextcloud app.

The problem: Each time cron comes do what it has to do, it also changes the IDs of files in folders that are mounted as external (Local). This breaks shared links…

And this is how I have setup my docker-compose.yml:

version: '3'

services:
  nc-db:
    image: mariadb:10.5
    command: --transaction-isolation=READ-COMMITTED --binlog-format=ROW
    restart: always
    volumes:
      - db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=SomePassword
    env_file:
      - db.env
    networks:
      traefik:

  nc-redis:
    image: redis:alpine
    restart: always
    networks:
      traefik:

  nc-app:
    image: nextcloud:me
    restart: always
    dns: 192.168.96.1
    volumes:
      - nextcloud:/var/www/html
      - /mnt/md0/share1:/var/www/html/data/share1
      - /mnt/md0/share2:/var/www/html/data/share2
      - /mnt/md0/share3:/var/www/html/data/share3
    environment:
      - MYSQL_HOST=nc-db
      - REDIS_HOST=nc-redis
      - NEXTCLOUD_TRUSTED_DOMAIN=cloud.example.com
      - TRUSTED_PROXIES=192.168.96.5
      - PHP_MEMORY_LIMIT=4G
      - NEXTCLOUD_UPDATE=1
      - PHP_UPLOAD_LIMIT=8G
      - PHP_MEMORY_LIMIT=8G
    env_file:
      - db.env
    depends_on:
      - nc-db
      - nc-redis
    networks:
      traefik:
    labels:
      - traefik.enable=true
      - traefik.http.routers.cloud.rule=Host(`cloud.example.com`)
      - traefik.http.routers.cloud.tls=true
      - traefik.http.routers.cloud.tls.certresolver=le
      - traefik.http.services.cloud.loadbalancer.server.port=80
      - traefik.http.routers.cloud.service=cloud
      - traefik.http.routers.cloud.entrypoints=websecure
      - traefik.docker.network=traefik
      - traefik.http.routers.cloud-http.entrypoints=web
      - traefik.http.routers.cloud-http.rule=Host(`cloud.example.com`)
      - traefik.http.routers.cloud-http.middlewares=https-redirect
      - traefik.http.middlewares.https-redirect.redirectscheme.scheme=https
      - traefik.http.middlewares.https-redirect.redirectscheme.permanent=true

volumes:
  db:
  nextcloud:

networks:
  traefik:
    external: true

Has anyone ever encountered this issue? Is it a config problem or a bug?

Thank you