How can I avoid iTerm trying to scp a file when ⌘-clicking it?
I know this is not a direct answer to your question, but here is how I have handled the situation in other cases. Instead of mounting your local volume at /app, mount it in the container at /path/to/my/project. That way the file has the same path name inside Docker as outside it and you can skip special processing of the path name in iTerm.
If you are running Docker Desktop for Mac, the default osxfs driver will handle for you the issues arising from the files having different owners and permissions inside the container than outside and you do not have to worry about it. (This is a unique benefit of running on the Mac, other platforms do not have this feature at this time.)