I've come back to this post xmas and managed to resolve. Was my mistake in the end however the error was not super clear.
I must have run either the setup.sh or docker compose up before creating the workspace directory. As a result the volume mount created the workspace directory for me, but with the owner as root:root.
When trying to debug I was looking in the dockerfile at the last few lines wondering why the chown -r $user:www-data $container_path was not applying correctly not realising it was being overwritten by the volume mount from the compose file. Was a silly thing to miss, my bad 😅 . Thank you for trying to help.
Fix:
Make sure the permissions/owner (775, $user) are set correctly on the ./workspace directory before running ./setup.sh.