-
Notifications
You must be signed in to change notification settings - Fork 287
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
alternatives to npm start #275
Comments
This doesn't entirely address the issue, but you should be able to run any script that is defined in your Last I checked, I think we actually run something like: see https://github.com/sclorg/s2i-nodejs-container/blob/master/14/s2i/bin/run#L20-L26 |
@ryanj I think maybe I need to explain this better. The issue isn't the target script, the issue is overhead of using It's minor, but if someone were to run an image built this way for a serverless/knative application then the 9x increased startup time (see second screenshot) could start to matter. Edit: Spelling |
Fyi - some info/discussion on this topic is provided in the Node.js Reference architecture: https://github.com/nodeshift/nodejs-reference-architecture/blob/main/docs/development/building-good-containers.md#avoiding-using-npm-to-start-application. It would be good to have a way to run without having to use npm. |
I've noticed that the resulting s2i image starts the Node.js application using npm start.
This is a good idea since it's common practice and enables a developer to set flags etc, but it does result in two Node.js processes being launched, as seen in this screenshot:
We have the
npm
process, and then the childnode
process.The
npm
process is mostly idle, but does consume memory and adds overhead on startup.Is it worth giving consideration to support a new environment variable that defines a shell script to use on startup instead?
The text was updated successfully, but these errors were encountered: