Public | Automated Build

Last pushed: 4 days ago
Short Description
Container running Nginx + PHP-FPM capable of pulling application code from git
Full Description


This is a Dockerfile/image to build a container for nginx and php-fpm, with the ability to pull website code from git when the container is created, as well as allowing the container to push and pull changes to the code to and from git. The container also has the ability to update templated files with variables passed to docker in order to update your code and settings. There is support for lets encrypt SSL configurations, custom nginx configs, core nginx/PHP variable overrides for running preferences, X-Forwarded-For headers and UID mapping for local volume support.

If you have improvements or suggestions please open an issue or pull request on the GitHub project page.


Docker Tag GitHub Release Nginx Version PHP Version Alpine Version
latest Master Branch 1.11.10 7.1.2 3.4

For other tags please see: versioning


Quick Start

To pull from docker hub:

docker pull richarvey/nginx-php-fpm:latest


To simply run the container:

sudo docker run -d richarvey/nginx-php-fpm

To dynamically pull code from git when starting:

docker run -d -e 'GIT_EMAIL=email_address' -e 'GIT_NAME=full_name' -e 'GIT_USERNAME=git_username' -e '' -e 'GIT_PERSONAL_TOKEN=<long_token_string_here>' richarvey/nginx-php-fpm:latest

You can then browse to http://<DOCKER_HOST> to view the default install files. To find your DOCKER_HOST use the docker inspect to get the IP address (normally

For more detailed examples and explanations please refer to the documentation.



Docker Pull Command
Source Repository

Comments (42)
11 days ago

php7 tag is back but unsupported

12 days ago

would php oci8 be included? for oracle.

24 days ago

I agree with @touhid on that - it would be helpful to keep the php7 tag, and also the /var/log/php7/ folder so we can pip PHP logs to stderr with:
RUN ln -sf /dev/stderr /var/log/php7/error.log

a month ago

Please keep the "php7" tag. Latest tag and "php7.1" is breaking some applications .

a month ago

@majest also if you need to use a specific version take a look at: you'll see you can still use PHP 7.1.1 if you don't use the latest tag

a month ago

@majest this reference - > /www/site/web/index.php is that something in your code?

a month ago

Oh, And it works fine on my local machine.. It doesn't work on AWS

a month ago

There are some problems with the latest 7.1.2 version.

Fatal error: Uncaught Exception: Could not gather sufficient random data in /www/site/web/index.php:23 Stack trace: #0 /www/site/web/index.php(23): session_start() #1 .....

I don't have this problem in 7.1.1. I'm not sure if anyone else is getting this. Maybe it's only me.

a month ago

@majest sorry I was going through tidying up and moving to tagged versions. I'll avoid this in future. Once again apologies.

a month ago

I was using php7 tag but it disappeared and new 7.1 breaks the dependencies for pear. Can you please not delete the old tags?