Structuring for Multiple Website Deployments

I’m wondering how any of you structure many websites into the UI of Rancher. Currently I build 3 containers for a single website: a nginx server container, a php-fpm container, and a mysql container. These three combined would institute one website. Should I structure these into a single stack, so that each new website I build has its own stack, and then an additional stack with a Load Balancer to handle the routing? I’m just looking for some best practices of organization when it comes to organizing websites that might be for individual clients.

I build websites / webspaces as stack, but I use a global MySQL stack just because of the resource usage (RAM) of a MySQL instance. MySQL is connected as external links. Loadbalancer also placed into a global stack.

I tried to use a env_file for each customer with variables (customer, project, …) and use the variables inside the docker-compose.yml to build a webspace, but it isn’t that simple…
The customer and project variables works fine for volume names, but doesn’t work for the service definition (first line). So you can’t deploy multiple webspaces to one stack.

Would be interesting to read more about multiple webspace deployments. What is the best way to do it?

  1. one stack for each webspace / website?
  2. Custom docker-compose file(s) to do multiple website deployments in one stack (1 stack = 1 customer?)

I’m not sure what’s the best / simplest way. Update a docker-compose file helps also to upgrade a stack…