Yes, it can be using subpath while mounting a volume subdirectory to a container. However,
volume must exist beforehand and
subdirectories must be created before containers attach to it
To create a volume with subfolders, I made a utility function for me to use. I do:
# source the function
source create_volume_with_folders.sh
# create a new volume with however many folders you want
create_volume_with_folders home_data pgadmin pgdata
After that, pay attention to setting external=True
for the volume in docker compose file. See from my create_volume_with_folders.sh Gist.