I currently have about 20 sites and applications hosted in AWS EC2. Some have their own EC2, whilst others share an EC2 with multiple virtual hosts on that EC2.
Each site is completely separate and unrelated from another. The ones which share an EC2 are generally much smaller with little traffic/resource requirement (hence the shared server).
I also have one EC2 server which is simply used to run batch and scheduled tasks alongside the live version of the site, to ensure the live site stays accessible even when the scheduled tasks are heavy.
I am looking to making use of Docker across my whole dev > prod environment for better use of server resources, and easier migrations between environments etc.
I’m keen to get your thoughts on the best practise for production server hardware.
Is it best to use one larger EC2 and have every site as its own docker container on there? This sounds like less server admin, a tidier overall setup, and from what I understand, each docker container still keeps itself to itself from a security point of view. But, any server issues or resource spikes would impact all sites (mitigated by a load balancer).
Or, am I best to keep them split across multiple EC2s, i.e. on EC2 per docker container? This seems completely against the point of docker, but not sure if I’m missing something.
Using a single EC2 for all sites then makes it easier (less admin) to set up load balancers and/or fall over servers too, but adds admin to serve totally different domains to different sites all within the same host.
Note; if it makes any difference, I use RDS for MySQL; no MySQl running on any EC2s directly.
Thanks in advance