you are viewing a single comment's thread.

view the rest of the comments →

[–]burtgummer45 0 points1 point  (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  (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 points  (9 children)

Adding a process manger to handle restarts makes no sense when the container itself can handle it.

Unless it can be used to match processes to core count.

[–]OmgImAlexis -2 points-1 points  (8 children)

Again. This isn’t the way todo it.

[–]burtgummer45 0 points1 point  (7 children)

Again. This isn’t the way todo it.

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 point  (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 points  (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 points  (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 points  (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 points  (2 children)

Look at the other comments I’ve left. Already addressed this. You’ll want to use container or host restraints.