{"id":28413372,"url":"https://github.com/vikbert/dockercentos","last_synced_at":"2025-06-24T20:30:50.983Z","repository":{"id":146599379,"uuid":"47750096","full_name":"vikbert/dockerCentos","owner":"vikbert","description":" centOS docker templates","archived":false,"fork":false,"pushed_at":"2015-12-10T09:05:53.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-03T15:26:37.550Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vikbert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-12-10T09:03:15.000Z","updated_at":"2015-12-10T09:03:44.000Z","dependencies_parsed_at":"2023-04-15T13:30:50.203Z","dependency_job_id":null,"html_url":"https://github.com/vikbert/dockerCentos","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vikbert/dockerCentos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikbert%2FdockerCentos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikbert%2FdockerCentos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikbert%2FdockerCentos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikbert%2FdockerCentos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vikbert","download_url":"https://codeload.github.com/vikbert/dockerCentos/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vikbert%2FdockerCentos/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261751429,"owners_count":23204421,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-03T04:34:00.787Z","updated_at":"2025-06-24T20:30:50.966Z","avatar_url":"https://github.com/vikbert.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx + PHP-FPM docker container\n[![Circle CI](https://circleci.com/gh/million12/docker-nginx-php/tree/master.svg?style=svg)](https://circleci.com/gh/million12/docker-nginx-php/tree/master)\n\n\nFor different PHP versions, look up different branches of this repository. On Docker Hub you can find them under different tags:    \n* `million12/nginx-php:latest` - PHP 5.6 (master branch)\n* `million12/nginx-php:php-55` - PHP 5.5 ([php-55](https://github.com/million12/docker-nginx-php/tree/php-55) branch)\n* `million12/nginx-php:php-70` - PHP 7.0-dev aka PHPNG ([php-70](https://github.com/million12/docker-nginx-php/tree/php-70) branch)\n\n\n#### Things included:\n\n#### Nginx\n\nThis image is based on [million12/nginx](https://github.com/million12/docker-nginx) - go there for more details.  \n**Default vhost** is configured and served from `/data/www/default`. Add .php file to that location to have it executed with PHP.\n\n#### - PHP-FPM\n\n**PHP 5.6** is up \u0026 running for default vhost. As soon as .php file is requested, the request will be redirected to PHP upstream. See [/etc/nginx/conf.d/php-location.conf](container-files/etc/nginx/conf.d/php-location.conf).\n\nFile [/etc/nginx/fastcgi_params](container-files/etc/nginx/fastcgi_params) has improved configuration to avoid repeating same config options for each vhost. This config works well with most PHP applications (e.g. Symfony2, TYPO3, Wordpress, Drupal).\n\nCustom PHP.ini directives are inside [/etc/php.d](container-files/etc/php.d/).\n\n#### Directory structure\n```\n/data/www # meant to contain web content\n/data/www/default # root directory for the default vhost\n/data/logs/ # Nginx, PHP logs\n/data/tmp/php/ # PHP temp directories\n```\n\n#### Error logging\n\nPHP errors are forwarded to stderr (by leaving empty value for INI error_log setting) and captured by supervisor. You can see them easily via `docker logs [container]`. In addition, they are captured by parent Nginx worker and logged to `/data/logs/nginx-error.log'. PHP-FPM logs are available in `/data/logs/php-fpm*.log` files. \n\n##### - pre-defined FastCGI cache for PHP backend\n\nIt's not used until specified in location {} context. In your vhost config you can add something like this:  \n```\nlocation ~ \\.php$ {\n    # Your standard directives...\n    include               fastcgi_params;\n    fastcgi_pass          php-upstream;\n    \n    # Use the configured cache (adjust fastcgi_cache_valid to your needs):\n    fastcgi_cache         APPCACHE;\n    fastcgi_cache_valid   60m;\n}\n```\n\n#### Common dev tools for web app development\n\n* Ruby 2.0, Bundler\n* NodeJS and NPM\n* NPM packages like gulp, grunt, bower, browser-sync\n\n## Usage\n\n```\ndocker run -d -v /data --name=web-data busybox\ndocker run -d --volumes-from=web-data -p=80:80 --name=web million12/nginx-php\n```\n\nAfter that you can see the default vhost content (something like: '*default vhost created on [timestamp]*') when you open http://CONTAINER_IP:PORT/ in the browser.\n\nYou can replace `/data/www/default/index.html` with `index.php` and, for instance, phpinfo() to inspect installed PHP setup. You can do that using separate container which mounts /data volume (`docker run -ti --volumes-from=web-data --rm busybox`) and adding the file to the above location.\n\n\n## Customise\n\nThere are several ways to customise this container, both in a runtime or when building new image on top of it:\n\n* See [million12:nginx](https://github.com/million12/docker-nginx) for info regarding Nginx customisation, adding new vhosts etc.\n* Override `/etc/nginx/fastcgi_params` if needed.\n* Add custom PHP `*.ini` files to `/etc/php.d/`.\n* Add own PHP-FPM .conf files to `/data/conf/php-fpm-www-*.conf` to modify PHP-FPM www pool.\n\n## ENV variables\n\n**NGINX_GENERATE_DEFAULT_VHOST**  \nDefault: `NGINX_GENERATE_DEFAULT_VHOST=false`  \nExample: `NGINX_GENERATE_DEFAULT_VHOST=true`  \nWhen set to `true`, dummy default (*catch-all*) Nginx vhost config file will be generated in `/etc/nginx/hosts.d/default.conf`. In addition, default index.php file will be created displaying results of `phpinfo()`. **Caveat**: this causes security leak because you expose detailed PHP configuration - remember to remove it on production!\nUse it if you need it, for example to test that your Nginx is working correctly AND/OR if you don't create default vhost config for your app but you still want some dummy catch-all vhost.\n\n**STATUS_PAGE_ALLOWED_IP**  \nDefault: `STATUS_PAGE_ALLOWED_IP=127.0.0.1`  \nExample: `STATUS_PAGE_ALLOWED_IP=10.1.1.0/16`  \nConfigure ip address that would be allowed to see PHP-FPM status page on `/fpm_status` URL.\n\n## Authors\n\nAuthor: Xun Zhou (xun.zhou@momox.biz)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikbert%2Fdockercentos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvikbert%2Fdockercentos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvikbert%2Fdockercentos/lists"}