I'm having an ongoing debate with myself about how to think about and use Docker containers.
From the literature and examples it seems like a container should really provide a service, or part of a stack. For example a container might run MySQL, or Apache, or redis, or whatever. I can understand why this is nice and clean, and makes sense.
In our scenario, we want to host multiple totally separate web applications (e-commerce stores, wordpress sites, static websites, node.js applications) all on the same server, and we want to use Docker. For me therefore it makes more sense for each container to be totally self-container, with the entire stack in itself e.g. each of my possibly several running wordpress containers would each have their own LAMP installation.
To apply the one-container-one-service model to this scenario seems to be very complicated - each application will have dependencies on other containers in the system which will in turn be depended on by other things. And what if you require multiple versions of a particular service.
Whilst this seems like the way to go, it also seems like it could be very inefficient? I'm not an expert on how LXCs work but even though everything is containerised, there really are all those apache2 workers and mysqlds running on the system, with all their associated overhead - is there going to be performance problems?
Does anyone have any thoughts?
I would prefer the one container per app approach. If you put every service in a single image/container, you have some advantages:
Since LXC and Docker seems to be very efficient, I wouldn't mind to use multiple containers. This is what Docker was designed for. And I think you will have a reasonable number, lets say <100 containers. So it shouldn't be a problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With