Specifying path.data and path.log in docker setup

Versions (relevant - OpenSearch/Dashboard/Server OS/Browser):
opensearch-2.12/Ubuntu 24

Describe the issue:
I would like setup opensearch in docker and specified the paths for path.log and path.data in the docker-compose.yml.

When starting the docker, it failed saying the paths were access denied even I have grant all read/write permission to the paths.

May I ask if it is possible to do like this? What i wanted to achieve is to put the index on a specific disk mounted.

Thanks in advance.

Configuration:

Relevant Logs or Screenshots:

@phchiu The folder for path.data and path.log should be assigned to the user with ID 1000 and group with id 1000 (see /etc/passwd and /etc/group) on the host side to match the opensearch user and group inside the container.