Docker architecture for hosting a PHP website Docker architecture for hosting a PHP website docker docker

Docker architecture for hosting a PHP website


I think the three nginx servers connected to the main nginx server are not necessary. The php-fpm process listens to a socket so you can directly connect to each php-fpm process from the main nginx server


I've got a nearly similar scenario running only one webserver. First of all I think you're setup is fine this way using a single container as reverse proxy and another for each webserver.

I'm not quiet sure if it's necessary running PHP in its own container. I'm using Apache instead of nginx (haters gonna hate) and created an own image for both giving me following docker-compose.yml

version: '2'services:  webproxy:    image: myown/webproxy:x.y    [...]  webserver:    image: myown/webserver:x.y    [...]

Regarding your second question: I've been to this question myself and I never seen a point in using data containers. The data uses same disk space but you don't know where it's stored. A little tricky for backups in my opinion. That's the reason I'm using your first approach mounting data volumes to host's disk.