We’re running such a setup in production; a sample Dockerfile can be found on https://github.com/WISVCH/docker-nginx.
We’re running such a setup in production; a sample Dockerfile can be found on https://github.com/WISVCH/docker-nginx.
From a general usability standpoint, a Node.js container with all build dependencies will surely turn into a bloated several hundred megabyte Docker image — an Nginx image with just the built static files is a lot smaller.
That being said, the Node.js ecosystem feels more immature than Python’s. The common practice of using microdependencies means that an average project has countless dependencies with varying levels of support — it’s all but impossible to make sure every one of those dependencies is properly maintained.
The framework/library churn rate seems to have decreased though, so that’s certainly good from a security standpoint as well.
But regarding sending static files, nginx uses Linux' sendFile[0] which outperforms anything in user-space.
Up until a few years ago this wasn't something Node could use. I'm not sure if still that's the case though. My information could be badly outdated.