I’m having a hard time understanding how to make bunch of PHP websites using Docker. I’d like to use Docker, so that I can scale this service. Also, each website is independent and executes arbitrary code, so each needs a kind of isolated chroot jail.

I just want to understand from a high level, what is required to do this kind of thing. I’m just beginning so please excuse the confusingness of this question:

Let’s say I have an image that has nginx on it with php. So I can spin up say 10 containers with this image. I can load balance across those images. But I don’t understand how I separate each “user” from each other. If a request comes in to a particular container, then nginx invokes php to execute, how can I setup that php execution environment to be isolated – that is, not know about the other users?