ols-docker-env icon indicating copy to clipboard operation
ols-docker-env copied to clipboard

Distinct lsphp, ols and php contents containers

Open realsamanrad opened this issue 1 year ago • 2 comments

Hi, I want to distinct the OLS, LSPHP and my website PHP codes images into separated containers (pods) to run in Kubernetes. And link between them to communicate.

When using Nginx, we can do this approach by separating Nginx, PHP-FPM and Dockerfile (main php codes) into distinct images.

Is there any workaround about this? Thanks

realsamanrad avatar Apr 17 '24 08:04 realsamanrad

Hi, I want to distinct the OLS, LSPHP and my website PHP codes images into separated containers (pods) to run in Kubernetes. And link between them to communicate.

When using Nginx, we can do this approach by separating Nginx, PHP-FPM and Dockerfile (main php codes) into distinct images.

Is there any workaround about this? Thanks

Hi 👋

As far as I know, OpenLiteSpeed (OLS) and LSPHP are tightly coupled via LSAPI, so they typically run in the same container.
Unlike Nginx + PHP-FPM, it’s not really possible to split them completely because OLS handles PHP internally through LSAPI instead of FastCGI.

A common approach is to keep OLS + LSPHP in one container and mount your PHP application from another image or volume.
That way you can still separate the app code from the web server layer in Kubernetes.

Hope this helps!

ducladev avatar Oct 24 '25 06:10 ducladev

OLS support namespace now. The easy solution is just enable namespace for each site, so PHP for each site will run in its own container. OLS runs in the host. https://docs.openlitespeed.org/config/advanced/namespaces/

litespeedtech avatar Oct 24 '25 13:10 litespeedtech