I would like to run two web services on a single physical server using Docker. Both services require a web server and a SQL database. The following setups are thinkable ([ ... ]
marks a Docker container):
- One docker container per service
[ sqld + httpd + service A ]
[ sqld + httpd + service B ]
- One docker container per process
[ sqld for A ] [ httpd for A ] [ service A ]
[ sqld for B ] [ httpd for B ] [ service B ]
- Shared sub-services
[ sqld ] [ httpd ]
[ service A ] [ service B ]
- Combined shared sub-services
[ sqld + httpd ]
[ service A ] [ service B ]
I can see benefits and drawbacks with either model, e.g. when it comes to process management/monitoring or when planing to move a service from one server to another one.
Are you aware of any technical reasons that would eliminate some of these choices, e.g. because it would be impossible to manage such a setup in a meaningful way or as security concerns clearly speak against them?
I'm not asking for an opinion here, like "Personally I prefer setup number ..., as ..."; it's okay to have a preferences and feel free to let me know about it but my concern here is only if there objective reasons that clearly speak against one of these setups. If I can rule out one or two of these, it will be much easier to weight the pros and cons of the remaining setups to my personal needs. And so far I see no reason that makes either setup impossible or clearly speaks against it but I might be overlooking something.