Hacker News new | ask | show | jobs
by Ramiro 1628 days ago
I never really thought about this, it's a good point. What do you suggest it's used instead of ["npm", "run", "start"]?
4 comments

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/tini

edit: formatting, sorry.

I think this is built into docker now: https://docs.docker.com/engine/reference/run/#specify-an-ini...

If you use Kubernetes then you have to add tini for now (https://github.com/kubernetes/kubernetes/issues/84210)

["node", "/path/to/your/entrypoint.js"]
I'm not a Node/NPM person, but I imagine they had in mind the equivalent of whatever is expected from npm. I expect some nodejs command to invoke the service directly

Edit: Consequently this should make the container logs a bit more useful, beyond better signal handling/respect

I assume it'd be better to execute index.js directly with node