We're hosting a lot of different applications on our Kubernetes cluster already - mostly Java based.
For PHP-FPM + Nginx our approach is currently, that we're building a container, which includes PHP-FPM, Nginx and the PHP application source code. But this actually breaks with the one-process-per-container docker rule, so we were thinking on how to improve it. We tried to replace it by using a pod with multiple containers - a nginx and a PHP container.
The big question is now where to put the source code. My initial idea was to use a data-only container, which we mount to the nginx and PHP-FPM container. The problem is, that there's seems to be no way to do this in Kubernetes yet.
The only approach that I see is creating a sidecar container, which contains the source code and copies it to an emptyDir volume which is shared between the containers in the pod.
My question: Is there a good approach for PHP-FPM + Nginx and a data container on Kubernetes, or what is best practice to host PHP on Kubernetes (maybe still using one container for everything)?