If you run the above docker command, which is directly from the docs, it copies everything inside of your current working directory. Not just PHP files.
That docker command isn't "copying" anything; it's mounting, and I really hope people aren't doing that in production. There's a separate section on running in production.