welcome to the forum @mantis38
AFAIK there is nothing wrong with examples. the only issue I see there are pretty basic and incomplete. For more complete/detailed examples please review
- Nextcloud docker-compose setup with notify_push (2024)
- Nextcloud docker compose setup with Caddy (2024)
I have no idea how your permission issues should be related to docker file example but definitely you should provide more details and logs.