Nginx and php-fpm for dockerhub builds
Last updated Jun 26, 2026
1.7k
Stars
833
Forks
16
Issues
0
Stars/day
Attention Score
77
Language breakdown
No language data available.
▸ Files
click to expand
README
nginx-php-fpm -

Overview
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.
Versioning
| Docker Tag | Git Release | Nginx Version | PHP Version | Alpine Version | |-----|-------|-----|--------|--------| | latest/For other tags please see: versioning
NOTE: From 2.0.5 onwards there are x86 and arm64 builds available
Links
- https://github.com/richarvey/nginx-php-fpm
- https://hub.docker.com/repository/docker/richarvey/nginx-php-fpm/general
Quick Start
To pull from docker hub:docker pull richarvey/nginx-php-fpm:latest
Running
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 'GITEMAIL=emailaddress' -e 'GITNAME=fullname' -e 'GITUSERNAME=gitusername' -e 'GITREPO=github.com/project' -e 'GITPERSONALTOKEN=<longtokenstringhere>' richarvey/nginx-php-fpm:latest
You can then browse to
://<DOCKERHOST> to view the default install files. To find your use the inspect to get the IP address (normally 172.17.0.2)
For more detailed examples and explanations please refer to the documentation.
Documentation
- Personal Access token - SSH Keys - Push - Pull - webroot - REAL IP / X-Forwarded-For Headers - Environment Variables - Setup - RenewalGuides
🔗 More in this category