Containerize your PHP application
Go to file
William 0276584b3f Ooops 2023-02-20 19:29:30 +01:00
Dockerfile Init 2023-02-20 19:27:36 +01:00 Ooops 2023-02-20 19:29:30 +01:00 Init 2023-02-20 19:27:36 +01:00
nginx.conf Init 2023-02-20 19:27:36 +01:00


Containing Nginx with FastCGI and Composer.



Clone the repo and build it locally

docker build --no-cache -f ./Dockerfile --tag sample-php-container

The container is now ready to be used, navigate to your project folder.


This will install and or update any packages located in your composer file.

docker run --rm -e UPDATE=1 -v ./:/www sample-php-container


Nginx serves files from the public directory. Any files Nginx fails to find locally will be redirected to index.php.

docker run -dt -v ./:/www -p 8080:8080 --name sample-php-container-name sample-php-container