Same issue here - permissions are identical and the host data dir’s been created prior to composing. I think the container user that the process runs under is different to root - it’s www-data or something.
.
I think you could do something under /var/www but not outside that code here