PHP chmod() Permission error

Yea it seems like a common issue. I have been searching for few days, but unfortunately I can’t find an answer that I understand what to do. I’m using nextcloud’s docker image directly, and I did map my nextcloud/html folder to the docker.
Here is an image from portainer, where I setup my nextcloud as a stack:


Here is the ls -la result
image

To be more specific on what I don’t understand, here are two solutions might related to my problem:

usually you use ‘sudo -u www-data’ to run as user www-data (uid:33) and just sudo to run as root (uid:0)
Nextcloud Upgrade to 24.0.7 breaking tables - #4 by Vincent_Stans

sudo chown -R http:http /usr/share/webapps/nextcloud/config
sudo chmod 750 /usr/share/webapps/nextcloud/config
Chmod(): Operation not permitted at /usr/share/webapps/nextcloud/lib/private/Log/File.php#84 - #11 by mGurusamy

Both of them has some sort of hint saying I need to set the ownership correctly; however, the ownership of both of my problematic files are already set to 777. I even set the check_data_directory_permissions to false in config.php. My understanding is that anyone should be able to access it, but why can’t nextcloud?