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.
This fork is mainly targted at maintaining 3 version of PHP : 5.6, 7.1 and 7.2 in parallel and few additional extensions.
- Original credits and fork goes to richarvey
- https://registry.hub.docker.com/u/phpdrone/nginx-php-fpm/
To pull from docker hub:
docker pull phpdrone/nginx-php-fpm:php72-latest
To simply run the container:
sudo docker run -d phpdrone/nginx-php-fpm:php72-latest
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 'GIT_REPO=github.com/project' -e 'GIT_PERSONAL_TOKEN=<long_token_string_here>' phpdrone/nginx-php-fpm:php72-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 172.17.0.2)
For more detailed examples and explanations please refer to the documentation.
- Building from source
- Versioning
- Config Flags
- Git Auth
- Personal Access token
- SSH Keys
- Git Commands
- Push
- Pull
- Repository layout / webroot
- webroot
- User / Group Identifiers
- Custom Nginx Config files
- REAL IP / X-Forwarded-For Headers
- Scripting and Templating
- Environment Variables
- Lets Encrypt Support
- Setup
- Renewal
- PHP Modules
- Xdebug
- Logging and Errors