If your NPM installs are mysteriously slow in Docker, try adding this line before 'npm install':
RUN npm config set registry https://registry.npmjs.org/
I don't know why it works, but it does.
RUN npm config set registry https://registry.npmjs.org/
I don't know why it works, but it does.