When initializing the container, mounted volumes from Windows will not respect the file permissions on WSL as it seems.
There were several cases when after adding files/folders through webserver user (www-data), there was a permission problem when trying to access through Visual Code.
A possible workaround could be the creation of a new user group that unites root and www-data groups. But these would need additional setup on the remote server side.
https://stackoverflow.com/a/70199699/3127170
When initializing the container, mounted volumes from Windows will not respect the file permissions on WSL as it seems. There were several cases when after adding files/folders through webserver user (www-data), there was a permission problem when trying to access through Visual Code.
There seems to be a problem with Docker and WSL i.e. Windows volumes: https://github.com/docker/for-win/issues/4824 https://forums.docker.com/t/permissions-issue-writing-to-docker-volume-inside-wsl2-filesystem/129510
A possible workaround could be the creation of a new user group that unites root and www-data groups. But these would need additional setup on the remote server side. https://stackoverflow.com/a/70199699/3127170
Maybe there is another solution, working with WSL metadata, as described here: https://learn.microsoft.com/en-us/windows/wsl/file-permissions?source=recommendations#wsl-metadata-on-windows-files