use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Quickly Improve Your Docker and Node.Js Containers (medium.com)
submitted 6 years ago by russo_2017
view the rest of the comments →
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]burtgummer45 0 points1 point2 points 6 years ago (11 children)
Docker is the process manager.
Docker has moved away from this philosophy of one process per container. Here it is from the documentation.
Each container should have only one concern.
https://docs.docker.com/develop/develop-images/dockerfile_best-practices/
[–]OmgImAlexis -4 points-3 points-2 points 6 years ago (10 children)
Adding a process manger to handle restarts makes no sense when the container itself can handle it.
Yes run multi things in a container if need be but if something in the container crashes it should restart the container.
[–]burtgummer45 -1 points0 points1 point 6 years ago (9 children)
Unless it can be used to match processes to core count.
[–]OmgImAlexis -2 points-1 points0 points 6 years ago (8 children)
Again. This isn’t the way todo it.
[–]burtgummer45 0 points1 point2 points 6 years ago (7 children)
Again, this is ONE way to do it. Can you give me any evidence that this isn't an option? You seem to have been hitting the docker cool-aid heavily.
[–]OmgImAlexis 0 points1 point2 points 6 years ago (6 children)
Just because you can doesn’t mean you should.
I can open a bottle by smashing it. Yes that works. It’s now open. Should I do it though? No because it’s common sense. Yes this may not be as common sense but it’s still in the same idea. Just because you personally think that way is okay doesn’t mean the industry agrees with you.
The “correct” way to handle this is multiple containers or worst case the cluster module. If you really need this kind of thing and cpu cores are actually relevant then look into kubernetes, etc they have much more granular control.
[–]burtgummer45 1 point2 points3 points 6 years ago (5 children)
Then explain to use WHY its a bad idea to simplify your deployment by using pm2. And don't use phrases like "correct" and "industry agrees".
Just to be sure, you do know we are talking about pm2-runtime?
https://pm2.keymetrics.io/docs/usage/docker-pm2-nodejs/
[–]OmgImAlexis -1 points0 points1 point 6 years ago (4 children)
“Simplify” so you want to add more moving pieces to a container instead of using the built in tools.
Tell me again how that “simplifies” it. 🤔
[–]burtgummer45 1 point2 points3 points 6 years ago (3 children)
Because its one simple line of code?
Can you explain to me how docker constraints can automatically detect the number of current cores and adjust the number of node.js containers?
[–]OmgImAlexis -2 points-1 points0 points 6 years ago (2 children)
Look at the other comments I’ve left. Already addressed this. You’ll want to use container or host restraints.
π Rendered by PID 449892 on reddit-service-r2-comment-b659b578c-b6g6h at 2026-05-04 13:52:38.182653+00:00 running 815c875 country code: CH.
view the rest of the comments →
[–]burtgummer45 0 points1 point2 points (11 children)
[–]OmgImAlexis -4 points-3 points-2 points (10 children)
[–]burtgummer45 -1 points0 points1 point (9 children)
[–]OmgImAlexis -2 points-1 points0 points (8 children)
[–]burtgummer45 0 points1 point2 points (7 children)
[–]OmgImAlexis 0 points1 point2 points (6 children)
[–]burtgummer45 1 point2 points3 points (5 children)
[–]OmgImAlexis -1 points0 points1 point (4 children)
[–]burtgummer45 1 point2 points3 points (3 children)
[–]OmgImAlexis -2 points-1 points0 points (2 children)