{"id":21664385,"url":"https://github.com/wayofdev/docker-php-dev","last_synced_at":"2025-10-15T03:34:27.452Z","repository":{"id":40469488,"uuid":"439746045","full_name":"wayofdev/docker-php-dev","owner":"wayofdev","description":"Docker PHP images for local development. Pre-configured with Xdebug, Composer, and dev tools. Based on wayofdev/docker-php-base. Multi-arch support for AMD64/ARM64.","archived":false,"fork":false,"pushed_at":"2025-10-01T21:58:30.000Z","size":925,"stargazers_count":8,"open_issues_count":7,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-01T23:33:31.183Z","etag":null,"topics":["alpine","ansible","cli","composer","devops","docker","docker-image","docker-php","faketime","fpm","laravel","multi-arch","php","php-docker","supervisord","xdebug"],"latest_commit_sha":null,"homepage":"https://wayof.dev","language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wayofdev.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"wayofdev"}},"created_at":"2021-12-19T00:51:48.000Z","updated_at":"2025-06-19T11:44:57.000Z","dependencies_parsed_at":"2023-12-18T11:27:46.226Z","dependency_job_id":"6482de9e-70fd-4bc3-9f00-a30cde8ae96e","html_url":"https://github.com/wayofdev/docker-php-dev","commit_stats":null,"previous_names":[],"tags_count":46,"template":false,"template_full_name":null,"purl":"pkg:github/wayofdev/docker-php-dev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fdocker-php-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fdocker-php-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fdocker-php-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fdocker-php-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wayofdev","download_url":"https://codeload.github.com/wayofdev/docker-php-dev/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wayofdev%2Fdocker-php-dev/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279043406,"owners_count":26091447,"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-15T02:00:07.814Z","response_time":56,"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":["alpine","ansible","cli","composer","devops","docker","docker-image","docker-php","faketime","fpm","laravel","multi-arch","php","php-docker","supervisord","xdebug"],"created_at":"2024-11-25T10:37:21.611Z","updated_at":"2025-10-15T03:34:27.435Z","avatar_url":"https://github.com/wayofdev.png","language":"Makefile","readme":"\u003cp align=\"center\"\u003e\n    \u003cbr\u003e\n    \u003ca href=\"https://wayof.dev\" target=\"_blank\"\u003e\n        \u003cpicture\u003e\n            \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/wayofdev/.github/master/assets/logo.gh-dark-mode-only.png\"\u003e\n            \u003cimg width=\"400\" src=\"https://raw.githubusercontent.com/wayofdev/.github/master/assets/logo.gh-light-mode-only.png\" alt=\"WayOfDev Logo\"\u003e\n        \u003c/picture\u003e\n    \u003c/a\u003e\n    \u003cbr\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://actions-badge.atrox.dev/wayofdev/docker-php-dev/goto\"\u003e\u003cimg alt=\"Build Status\" src=\"https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fwayofdev%2Fdocker-php-dev%2Fbadge\u0026style=flat-square\"/\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/wayofdev/docker-php-dev/tags\"\u003e\u003cimg src=\"https://img.shields.io/github/v/tag/wayofdev/docker-php-dev?sort=semver\u0026style=flat-square\" alt=\"Latest Version\"\u003e\u003c/a\u003e\n\u003ca href=\"https://hub.docker.com/repository/docker/wayofdev/php-dev\"\u003e\u003cimg alt=\"Docker Pulls\" src=\"https://img.shields.io/docker/pulls/wayofdev/php-dev?style=flat-square\"\u003e\u003c/a\u003e\n\u003ca href=\"LICENSE.md\"\u003e\u003cimg src=\"https://img.shields.io/github/license/wayofdev/docker-php-dev.svg?style=flat-square\u0026color=blue\" alt=\"Software License\"/\u003e\u003c/a\u003e\n\u003ca href=\"#\"\u003e\u003cimg alt=\"Commits since latest release\" src=\"https://img.shields.io/github/commits-since/wayofdev/docker-php-dev/latest?style=flat-square\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n# Docker Image: PHP Dev(el)\n\nThis project provides Docker images for PHP development environments, built on top of the [wayofdev/docker-php-base](https://github.com/wayofdev/docker-php-base) images. It's designed to offer a convenient, feature-rich alternative to Laravel Sail for local development.\n\n\u003cbr\u003e\n\nIf you **like/use** this package, please consider ⭐️ **starring** it. Thanks!\n\n\u003cbr\u003e\n\n## 🚀 Features\n\n- **Based on wayofdev/docker-php-base:** Inherits all features and extensions from the base image.\n- **PHP Versions:** Supports PHP `8.1`, `8.2`, `8.3`, and `8.4`.\n- **Image Types:** Available in CLI, FPM, and Supervisord variants.\n- **Xdebug:** Pre-installed and configured for debugging.\n- **Development Tools:** Includes `git`, `bash`, `unzip`, `nano`, and more.\n- **Composer:** Pre-installed for PHP dependency management.\n- **Time Manipulation:** Includes `libfaketime` for testing time-dependent code.\n- **Service Readiness:** Includes `wait4x` for checking service availability.\n- **Multi-architecture:** Built for both **AMD64** and **ARM64** architectures.\n\n\u003cbr\u003e\n\n## 📦 Additional PHP Extensions\n\nOn top of the extensions provided by the base image, this development image includes:\n\n| Extension | Description         | Type |\n|-----------|---------------------|------|\n| xdebug    | Debugging extension | pecl |\n\n\u003cbr\u003e\n\n## 🛠 Included Development Tools\n\n| Package                                           | Type |\n|---------------------------------------------------|------|\n| git                                               | apk  |\n| bash                                              | apk  |\n| unzip                                             | apk  |\n| nano                                              | apk  |\n| [faketime](https://github.com/wolfcw/libfaketime) | apk  |\n| [wait4x](https://github.com/atkrad/wait4x)        | apk  |\n| composer                                          | bin  |\n| [phive](https://github.com/phar-io/phive)         | bin  |\n\n\u003cbr\u003e\n\n## 🚀 Usage\n\n### → Pulling the Image\n\n```bash\ndocker pull wayofdev/php-dev:8.3-fpm-alpine-latest\n```\n\nReplace `8.3-fpm-alpine-latest` with your desired PHP version, type, and tag.\n\n### → Available Image Variants\n\n- **PHP Versions:** 8.1, 8.2, 8.3, 8.4\n- **Types:** cli, fpm, supervisord\n- **Architectures:** amd64, arm64\n\n#### Examples\n\n```bash\n# PHP 8.1 CLI\ndocker pull wayofdev/php-dev:8.1-cli-alpine-latest\n\n# PHP 8.2 FPM\ndocker pull wayofdev/php-dev:8.2-fpm-alpine-latest\n\n# PHP 8.3 with Supervisord\ndocker pull wayofdev/php-dev:8.3-supervisord-alpine-latest\n```\n\n### → Using in Docker Compose\n\nHere's a more comprehensive example `docker-compose.yml` for a Laravel project with additional services:\n\n```yaml\nservices:\n  app:\n    image: wayofdev/php-dev:8.3-fpm-alpine-latest\n    container_name: ${COMPOSE_PROJECT_NAME}-app\n    restart: on-failure\n    networks:\n      - default\n      - shared\n    depends_on:\n      - database\n    links:\n      - database\n    volumes:\n      - ./.github/assets:/assets:rw,cached\n      - ./app:/app:rw,cached\n      - ./.env:/app/.env\n      - ~/.composer:/.composer\n      - ~/.ssh:/home/www-data/.ssh\n    environment:\n      FAKETIME: '+2h'\n      XDEBUG_MODE: '${XDEBUG_MODE:-off}'\n      PHIVE_HOME: /app/.phive\n    dns:\n      - 8.8.8.8\n    extra_hosts:\n      - 'host.docker.internal:host-gateway'\n\n  web:\n    image: wayofdev/nginx:k8s-alpine-latest\n    container_name: ${COMPOSE_PROJECT_NAME}-web\n    restart: on-failure\n    networks:\n      - default\n      - shared\n    depends_on:\n      - app\n    links:\n      - app\n    volumes:\n      - ./app:/app:rw,cached\n      - ./.env:/app/.env\n    labels:\n      - traefik.enable=true\n      - traefik.http.routers.api-${COMPOSE_PROJECT_NAME}-secure.rule=Host(`api.${COMPOSE_PROJECT_NAME}.docker`)\n      - traefik.http.routers.api-${COMPOSE_PROJECT_NAME}-secure.entrypoints=websecure\n      - traefik.http.routers.api-${COMPOSE_PROJECT_NAME}-secure.tls=true\n      - traefik.http.services.api-${COMPOSE_PROJECT_NAME}-secure.loadbalancer.server.port=8880\n      - traefik.docker.network=network.${SHARED_SERVICES_NAMESPACE}\n```\n\n#### This configuration includes\n\n- An `app` service using the `wayofdev/php-dev` image for PHP processing.\n- A `web` service using a [custom Nginx image](https://github.com/wayofdev/docker-nginx) for serving the application.\n- Network configuration for both default and shared networks.\n- Volume mounts for application code, assets, and configuration files.\n- Environment variables for PHP and Xdebug configuration.\n- Traefik labels for reverse proxy and SSL termination.\n\n#### Real-world Example\n\nFor a comprehensive, real-world example of how to use this image in a Docker Compose setup, please refer to the [wayofdev/laravel-starter-tpl](https://github.com/wayofdev/laravel-starter-tpl) repository. This template provides a fully configured development environment for Laravel projects using the `wayofdev/php-dev` image.\n\n\u003cbr\u003e\n\n## 🔨 Development\n\nThis project uses a set of tools for development and testing. The `Makefile` provides various commands to streamline the development process.\n\n### → Requirements\n\n- Docker\n- Make\n- Ansible\n- goss and dgoss for testing\n\n### → Setting Up the Development Environment\n\nClone the repository:\n\n```bash\ngit clone git@github.com:wayofdev/docker-php-dev.git \u0026\u0026 \\\ncd docker-php-dev\n```\n\n### → Generating Dockerfiles\n\nAnsible is used to generate Dockerfiles and configurations. To generate distributable Dockerfiles from Jinja template source code:\n\n```bash\nmake generate\n```\n\n### → Building Images\n\n- Build the default image:\n\n  ```bash\n  make build\n  ```\n\n  This command builds the image specified by the `IMAGE_TEMPLATE` variable in the Makefile. By default, it's set to `8.3-fpm-alpine`.\n\n- Build a specific image:\n\n  ```bash\n  make build IMAGE_TEMPLATE=\"8.3-fpm-alpine\"\n  ```\n\n  Replace `8.3-fpm-alpine` with your desired PHP version, type, and OS.\n\n- Build all images:\n\n  ```bash\n  make build IMAGE_TEMPLATE=\"8.1-cli-alpine\"\n  make build IMAGE_TEMPLATE=\"8.1-fpm-alpine\"\n  make build IMAGE_TEMPLATE=\"8.1-supervisord-alpine\"\n  make build IMAGE_TEMPLATE=\"8.2-cli-alpine\"\n  make build IMAGE_TEMPLATE=\"8.2-fpm-alpine\"\n  make build IMAGE_TEMPLATE=\"8.2-supervisord-alpine\"\n  make build IMAGE_TEMPLATE=\"8.3-cli-alpine\"\n  make build IMAGE_TEMPLATE=\"8.3-fpm-alpine\"\n  make build IMAGE_TEMPLATE=\"8.3-supervisord-alpine\"\n  make build IMAGE_TEMPLATE=\"8.4-cli-alpine\"\n  make build IMAGE_TEMPLATE=\"8.4-fpm-alpine\"\n  make build IMAGE_TEMPLATE=\"8.4-supervisord-alpine\"\n  ```\n\n  These commands will build all supported image variants.\n\n\u003cbr\u003e\n\n## 🧪 Testing\n\nThis project uses a testing approach to ensure the quality and functionality of the Docker images. The primary testing tool is [dgoss](https://github.com/aelsabbahy/goss/tree/master/extras/dgoss), which allows for testing Docker containers.\n\n### → Running Tests\n\nYou can run tests using the following commands:\n\n- Test the default image:\n\n  ```bash\n  make test\n  ```\n\n  This command tests the image specified by the `IMAGE_TEMPLATE` variable in the Makefile (default is `8.3-fpm-alpine`).\n\n- Test a specific image:\n\n  ```bash\n  make test IMAGE_TEMPLATE=\"8.3-fpm-alpine\"\n  ```\n\n  Replace `8.3-fpm-alpine` with your desired PHP version, type, and OS.\n\n- Test all images:\n\n  ```bash\n  make test IMAGE_TEMPLATE=\"8.1-cli-alpine\"\n  make test IMAGE_TEMPLATE=\"8.1-fpm-alpine\"\n  make test IMAGE_TEMPLATE=\"8.1-supervisord-alpine\"\n  make test IMAGE_TEMPLATE=\"8.2-cli-alpine\"\n  make test IMAGE_TEMPLATE=\"8.2-fpm-alpine\"\n  make test IMAGE_TEMPLATE=\"8.2-supervisord-alpine\"\n  make test IMAGE_TEMPLATE=\"8.3-cli-alpine\"\n  make test IMAGE_TEMPLATE=\"8.3-fpm-alpine\"\n  make test IMAGE_TEMPLATE=\"8.3-supervisord-alpine\"\n  make test IMAGE_TEMPLATE=\"8.4-cli-alpine\"\n  make test IMAGE_TEMPLATE=\"8.4-fpm-alpine\"\n  make test IMAGE_TEMPLATE=\"8.4-supervisord-alpine\"\n  ```\n\n### → Test Configuration\n\nThe test configurations are defined in `goss.yaml` files, which are generated for each image variant. These files specify the tests to be run, including:\n\n- File existence and permissions\n- Process checks\n- Port availability\n- Package installations\n- Command outputs\n- PHP extension availability\n\n### → Test Process\n\nWhen you run the `make test` command, the following steps occur:\n\n1. The specified Docker image is built (if not already present).\n2. dgoss runs the tests defined in the `goss.yaml` file against the Docker container.\n3. The test results are displayed in the console.\n\n\u003cbr\u003e\n\n## 🔒 Security Policy\n\nThis project has a [security policy](.github/SECURITY.md).\n\n\u003cbr\u003e\n\n## 🙌 Want to Contribute?\n\nThank you for considering contributing to the wayofdev community! We are open to all kinds of contributions. If you want to:\n\n- 🤔 [Suggest a feature](https://github.com/wayofdev/docker-php-dev/issues/new?assignees=\u0026labels=type%3A+enhancement\u0026projects=\u0026template=2-feature-request.yml\u0026title=%5BFeature%5D%3A+)\n- 🐛 [Report an issue](https://github.com/wayofdev/docker-php-dev/issues/new?assignees=\u0026labels=type%3A+documentation%2Ctype%3A+maintenance\u0026projects=\u0026template=1-bug-report.yml\u0026title=%5BBug%5D%3A+)\n- 📖 [Improve documentation](https://github.com/wayofdev/docker-php-dev/issues/new?assignees=\u0026labels=type%3A+documentation%2Ctype%3A+maintenance\u0026projects=\u0026template=4-docs-bug-report.yml\u0026title=%5BDocs%5D%3A+)\n- 👨‍💻 [Contribute to the code](./.github/CONTRIBUTING.md)\n\nYou are more than welcome. Before contributing, kindly check our [contribution guidelines](.github/CONTRIBUTING.md).\n\n[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=for-the-badge)](https://conventionalcommits.org)\n\n\u003cbr\u003e\n\n## 🫡 Contributors\n\n\u003cp align=\"left\"\u003e\n\u003ca href=\"https://github.com/wayofdev/docker-php-dev/graphs/contributors\"\u003e\n\u003cimg align=\"left\" src=\"https://img.shields.io/github/contributors-anon/wayofdev/docker-php-dev?style=for-the-badge\" alt=\"Contributors Badge\"/\u003e\n\u003c/a\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n\u003c/p\u003e\n\n## 🌐 Social Links\n\n- **Twitter:** Follow our organization [@wayofdev](https://twitter.com/intent/follow?screen_name=wayofdev) and the author [@wlotyp](https://twitter.com/intent/follow?screen_name=wlotyp).\n- **Discord:** Join our community on [Discord](https://discord.gg/CE3TcCC5vr).\n\n\u003cbr\u003e\n\n## ⚖️ License\n\n[![Licence](https://img.shields.io/github/license/wayofdev/docker-php-dev?style=for-the-badge\u0026color=blue)](./LICENSE.md)\n\n\u003cbr\u003e\n","funding_links":["https://github.com/sponsors/wayofdev"],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayofdev%2Fdocker-php-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwayofdev%2Fdocker-php-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwayofdev%2Fdocker-php-dev/lists"}