A very common mistake I see (though not related to image size perse) when running Node apps is to do CMD ["npm", "run", "start"]. This is first memory wasteful, as npm is running as the parent process and forking node to run the main script. Also, the bigger problem is that the npm process does not send signals down to its child thus SIGINT and SIGTERM are not passed from npm into node which means your server may not be gracefully closing connections.
I never really thought about this, it's a good point. What do you suggest it's used instead of ["npm", "run", "start"]?
This is a great use case for tini[0]. Try this, after installing the tini binary to /sbin:
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["node", "/path/to/main/process.js"]
[0]: https://github.com/krallin/tiniedit: formatting, sorry.