I have this error at docker build but only with versions >4.3.0, i had been able to build with this same dockerfile and strapi version 4.2.3, i’m not sure about what to add in the dockerfile.
I had the same issue and found your thread.
For my case it was because local node-version was different from my target server.
I had local nodejs 16 but the target server was on 12.
Did you manage to fix the issue? I’ve got the same one. Trying to deploy to railway with TypeScript and I can’t even get the base app to build properly.