DEV Community

Cover image for Isolating PHP with Docker Containers

Isolating PHP with Docker Containers

John McCracken on November 01, 2018

Docker is a great piece of technology. It's a nice way to setup a development environment or experiment with new software without actually clogging...
Collapse
 
david_j_eddy profile image
David J Eddy

You combined two of my favorite topics; PHP and containerization :D. Nice example and interesting setup. Did you consider forgoing nginx and using PHP's built in server; since this was for dev/test/proof of concept?

any time you want to talk PHP or containers please feel free to message me :D.

Collapse
 
johnmccuk profile image
John McCracken

Thanks for the kind words David.

No it never even occurred to me to use the PHP built in server, maybe something I should look into.

lol, you don't know what your letting yourself in for, I have lots of Docker questions bouncing about in my head!

Collapse
 
david_j_eddy profile image
David J Eddy

Hit me up. :)

Collapse
 
mahmoudz profile image
Mahmoud Zalt

I'm using laradock.io (A full PHP development environment for Docker).

Collapse
 
antoroxico profile image
antoroxico

Hi, I'm new in docker and nginx. Is it possible to choose the version of php fpm by directory and not by hostname?. Could you illustrate the way or guide me in the right direction?

Collapse
 
lubu12 profile image
Andrew Yeung

Here is my solution on choosing php-fpm by directory.
github.com/lubu12/docker-nginx-php...

Hope it helps.

Collapse
 
jleonardolemos profile image
Leonardo Lemos

Nice article, thanks!!

For a simple development container can we merge both php and nginx container?? Is it possible? do we need to run 2 processes what is wrong by the book, but is it possible?