{"id":23359824,"url":"https://github.com/firehed/docker-nginx-php-frontcontroller","last_synced_at":"2026-02-12T10:06:36.885Z","repository":{"id":138434872,"uuid":"98148910","full_name":"Firehed/docker-nginx-php-frontcontroller","owner":"Firehed","description":"Docker image for the Nginx half of a PHP web stack","archived":false,"fork":false,"pushed_at":"2018-08-19T17:36:08.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-20T15:42:11.295Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Dockerfile","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/Firehed.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-07-24T04:27:22.000Z","updated_at":"2020-07-28T00:13:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"0b19549c-aef4-4d2a-8069-541a09552f66","html_url":"https://github.com/Firehed/docker-nginx-php-frontcontroller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Firehed/docker-nginx-php-frontcontroller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fdocker-nginx-php-frontcontroller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fdocker-nginx-php-frontcontroller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fdocker-nginx-php-frontcontroller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fdocker-nginx-php-frontcontroller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Firehed","download_url":"https://codeload.github.com/Firehed/docker-nginx-php-frontcontroller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fdocker-nginx-php-frontcontroller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29363010,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2024-12-21T11:12:04.588Z","updated_at":"2026-02-12T10:06:36.866Z","avatar_url":"https://github.com/Firehed.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Nginx PHP Front-Controller\n\nThis is a very basic image for a typical PHP \"front controller\" application.\n\n## Requirements\n\nThis image is meant to be put behind an SSL terminator of some kind.\nThat can be done with some Ingress controllers, a LoadBalancer service pointing to some sort of webserver, or any number of other things.\nBe creative!\n\nYour \"public\" code must live in a directory named `public/`.\nIn a typical modern PHP application using the following directory structure, you may already be doing this:\n\n```\nroot\n |- public/\n |   |- index.php\n |- src/\n |- vendor/\n```\nThis forced structure is (more or less) a limitation of PHP-FPM, since it depends on the `SCRIPT_FILENAME` FastCGI parameter, which contains the full path to the file.\nYou can probably work around this with some unpleasant symlinking magic, but it's not recommended or supported.\n\n## Usage\n\nUse this as a base image, and copy your application's public assets across:\n\n```docker\nFROM firehed/nginx-php-frontcontroller\nCOPY public .\n```\n\nIf you don't have any static assets, you may be able to just run this image directly; it will place an empty `index.php` file in the public directory by default.\nNginx does not actually execute the contents of this file; it just detects the request and sends it to PHP-FPM.\n\n\nAlongside this, build a \"full\" PHP-FPM image:\n\n```docker\nFROM php:7.1-fpm-alpine\nCOPY . .\n```\n\n## Deployment\n\n### Kubernetes\nRun both of the images created in the steps above in the same Pod:\n\n```yaml\n---\napiVersion: apps/v1beta1\nkind: Deployment\nmetadata:\n  name: www\nspec:\n  template:\n    metadata:\n      labels:\n        app: www\n    spec:\n      containers:\n        - image: your-www-image\n          name: www\n          ports:\n            - containerPort: 80\n              name: www\n        - image: your-fpm-image\n          name: fpm\n          ports:\n            - containerPort: 9000\n              name: php-fpm\n```\n(env vars, secrets, etc. should only need to be loaded in the FPM image)\n\n### Other Environments\nThis should also work just fine with `docker-compose`, but as I'm not using it I don't have an example.\nFeel free to contribute one!\n\n## Notes\nThis image mirrors the Official PHP-FPM image's directory structure, serving out of `/var/www/html`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirehed%2Fdocker-nginx-php-frontcontroller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirehed%2Fdocker-nginx-php-frontcontroller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirehed%2Fdocker-nginx-php-frontcontroller/lists"}