1Create file .dockerignore in your docker build context directory (so in this case, most likely a directory that is a parent to node_modules) with one line in it:
2
3**/node_modules
4although you probably just want:
5
6node_modules
7Info about dockerignore: https://docs.docker.com/engine/reference/builder/#dockerignore-file