Verification or is back. 1
What is your opinion on the usage of supervisor D. 2
So that's a great question. 3
Supervisor D I'm assuming what you're referring to is putting supervisor in the container and running 4
it as the PID one or the root process right in that container. 5
That is fine if you need to do it right. 6
I know Docker is best practices are never more than one app per container. 7
And I like to expose sort of take that idea and say it's really never more than one concern per container. 8
And when in some cases that concern might be multiple executable. 9
And so you would need to start of those with something else. 10
And it could be some sort of fancy shell scripting. 11
I like using supervisor D. 12
In fact if you look at my HP repo I do that I have a horribly outdated P HP repo for level so I definitely 13
need some updates to use some of the modern new Docker features but it shows off a couple of things 14
that are unique and one of those is that for PDP when you're using NPM you need the PDP executable running 15
and the engine X executable running and you could run those in separate containers and that would probably 16
be the official Docker way to do it. 17
If you were following their guidelines but their guidelines are just that they're just like best practices. 18
They're the place to start but it doesn't mean you have to stay there if you know what you're doing 19
and why you're doing it. 20
So in my case I would in this particular example I combine both engine X and the p HP FGM into the same 21
container image and I run them both with supervisor D and so it adds another layer of complexity because 22
now I have Docker running a container that's actually running supervisor as supervisors running engine 23
X and FGM but I find that it works well and I've ran. 24
I've run this on very large global Web sites that are running in lots of regions and abuse. 25
So this design is definitely time tested and is used in heavily heavy scenarios. 26
The reason I like this is because Docker and swarm out of the box don't have the concept of a pod. 27
If you're in Cuba and 80s world you have a pod concept and in that case you could run the engine X and 28
the PSP side by side in their own containers inside the same pod and that pod is deployed together. 29
So when it's deployed onto a server you would know that you'd get both and then they would both be able 30
to use the sockets if you're familiar with this stuff and PSP they use the sockets to talk back and 31
forth and that's very efficient but in the docker swarm way you would do it of the box that way you 32
would have to talk over TGP and that adds lots of lag. 33
I mean that lots of lag it's maybe fine for some people but when you're talking about going across server 34
instead of just talking over a local socket inside the same kernel there's definitely added you know 35
possibly multiple milliseconds if not tens of milliseconds of delay there. 36
So I like to run them both in the same container and I use supervisor D to do that. 37
So check out that example. 38
I will throw that in chat. 39
I think I saw someone post that in there already. 40
So hopefully that helps you out and that answers your question. 41
There's only a few places by the way that I use supervisor D and that's one of them. 42
The other one might be like cold fusion because it also needs like a patch or something on the front 43
end in order to work or area Gen-X. 44
So anytime you have something where you've got a back in binary that has to run to Amul to run your 45
code and then you need some sort of web server in front of it and they have to both work together to 46
to deliver the service it total because they're always going to be deployed together and one doesn't 47
work without the other. 48
It makes complete sense that they go together in that case in the same image especially when you scale 49
them if you're always going to scale them one for one because a lot of things with containers you would 50
want to scale differently right you're gonna scale the number of API is different you're going to scale 51
the number database container. 52
So in those cases you definitely with the flexibility and you want to build to update them on separately. 53
In this case I'm just going to update the app at the same time and I'm always going to replace the containers 54
at the same time so it makes a lot of sense to do those together so hopefully that helps.