{"id":16060799,"url":"https://github.com/geerlingguy/php-apache-container","last_synced_at":"2025-10-09T04:06:41.510Z","repository":{"id":54257642,"uuid":"135776556","full_name":"geerlingguy/php-apache-container","owner":"geerlingguy","description":"PHP + Apache container for running PHP web apps with Docker, built with Ansible.","archived":false,"fork":false,"pushed_at":"2024-07-24T16:46:47.000Z","size":24,"stargazers_count":36,"open_issues_count":0,"forks_count":11,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-24T14:50:39.855Z","etag":null,"topics":["ansible","apache","apache-php","container","docker","image","php"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/geerlingguy/php-apache/","language":null,"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/geerlingguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null},"funding":{"github":"geerlingguy","patreon":"geerlingguy"}},"created_at":"2018-06-02T01:09:48.000Z","updated_at":"2024-07-24T16:46:51.000Z","dependencies_parsed_at":"2025-06-24T14:39:54.621Z","dependency_job_id":"3c62f196-9ccd-42a2-bf18-1a615f87df42","html_url":"https://github.com/geerlingguy/php-apache-container","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/geerlingguy/php-apache-container","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fphp-apache-container","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fphp-apache-container/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fphp-apache-container/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fphp-apache-container/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geerlingguy","download_url":"https://codeload.github.com/geerlingguy/php-apache-container/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fphp-apache-container/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000758,"owners_count":26082921,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["ansible","apache","apache-php","container","docker","image","php"],"created_at":"2024-10-09T04:06:35.100Z","updated_at":"2025-10-09T04:06:41.445Z","avatar_url":"https://github.com/geerlingguy.png","language":null,"readme":"# PHP Apache Container (Built with Ansible)\n\n[![Build](https://github.com/geerlingguy/php-apache-container/actions/workflows/build.yml/badge.svg)](https://github.com/geerlingguy/php-apache-container/actions/workflows/build.yml) [![Docker pulls](https://img.shields.io/docker/pulls/geerlingguy/php-apache)](https://hub.docker.com/r/geerlingguy/php-apache/)\n\nThis project is composed of three main parts:\n\n  - **Ansible project**: This project is maintained on GitHub: [geerlingguy/php-apache-container](https://github.com/geerlingguy/php-apache-container). Please file issues, support requests, etc. against this GitHub repository.\n  - **Docker Hub Image**: If you just want to use [the `geerlingguy/php-apache` Docker image](https://hub.docker.com/r/geerlingguy/php-apache/) in your project, you can pull it from Docker Hub.\n  - **Ansible Role**: If you need a flexible Ansible role that's compatible with both traditional servers and containerized builds, check out [`geerlingguy.php`](https://galaxy.ansible.com/geerlingguy/php/) on Ansible Galaxy. (This is the Ansible role that does the bulk of the work in managing the PHP container.)\n\n## Versions\n\nCurrently maintained versions include:\n\n  - `8.3`, `8.3.x`, `latest`: PHP 8.3.x\n  - `8.2`, `8.2.x`: PHP 8.2.x\n  - `8.1`, `8.1.x`: PHP 8.1.x\n\n## Standalone Usage\n\nIf you want to use the `geerlingguy/php-apache` image from Docker Hub, you don't need to install or use this project at all. You can quickly build a PHP container locally with:\n\n    docker run -d --name=php-apache -p 80:80 geerlingguy/php-apache:latest /usr/sbin/apache2ctl -D FOREGROUND\n\nYou can also wrap up that configuration in a `Dockerfile` and/or a `docker-compose.yml` file if you want to keep things simple. For example:\n\n    version: \"3\"\n    \n    services:\n      php-apache:\n        image: geerlingguy/php-apache:latest\n        container_name: php-apache\n        ports:\n          - \"80:80\"\n        restart: always\n        # See 'Custom PHP codebase' for instructions for volumes.\n        volumes: []\n\nThen run:\n\n    docker-compose up -d\n\nNow you should be able to access the default home page at `http://localhost/`.\n\n### Custom PHP codebase\n\nIf you have a codebase inside the folder `web`, mount it as a volume like `-v ./web:/var/www/html:rw,delegated`.\n\nOr, if using a Docker Compose file:\n\n    services:\n      myapp:\n        ...\n        volumes:\n          - ./web:/var/www/html:rw,delegated\n\nIf you wish to build an image using this image as the base (e.g. for deploying to production), create a Dockerfile and `COPY` the webroot into place so it's part of the image.\n\nIf you want to run multiple webroots, or need to further customize the Apache VirtualHost definitions, you can mount a config file over the existing one in the container, e.g.:\n\n    services:\n      myapp:\n        ...\n        volumes:\n          - ./web:/var/www/html:rw,delegated\n          - ./virtualhosts.conf:/etc/apache2/sites-enabled/vhosts.conf:rw\n\nSimilarly, you can mount a PHP config file to the path `/etc/php/8.3/apache2/php.ini` (substitute whatever PHP version you're currently using in that path).\n\n## Management with Ansible\n\n### Prerequisites\n\nBefore using this project to build and maintain PHP images for Docker, you need to have the following installed:\n\n  - [Docker Community Edition](https://docs.docker.com/engine/installation/) (for Mac, Windows, or Linux)\n  - [Ansible](http://docs.ansible.com/ansible/latest/installation_guide/intro_installation.html)\n\n### Build the image\n\nFirst, install Ansible role requirements:\n\n    ansible-galaxy install -r requirements.yml\n\nThen, make sure Docker is running, and run the playbook to build the container:\n\n    ansible-playbook --extra-vars=\"@vars/8.2.yml\" main.yml\n\n(Substitute whatever supported PHP version you desire in the vars path) Once the image is built, you can run `docker images` to see the `php-apache` image that was generated.\n\n\u003e Note: If you get an error like `Failed to import docker`, run `pip install docker`.\n\n### Push the image to Docker Hub\n\nSee the `.github/workflows/build.yml` file in this repository for how it pushes all the tagged images automatically on any commit to the `master` branch.\n\n## License\n\nMIT / BSD\n\n## Author Information\n\nThis container build was created in 2018 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).\n","funding_links":["https://github.com/sponsors/geerlingguy","https://patreon.com/geerlingguy"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2Fphp-apache-container","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeerlingguy%2Fphp-apache-container","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2Fphp-apache-container/lists"}