{"id":30030098,"url":"https://github.com/arielespinoza07/php-dev-stack","last_synced_at":"2025-12-30T19:04:43.269Z","repository":{"id":308371389,"uuid":"1032556811","full_name":"ArielEspinoza07/php-dev-stack","owner":"ArielEspinoza07","description":"🐳 A powerful Docker-based development environment for any PHP project — supports multiple PHP versions (5.6–8.3), Laravel, Symfony, WordPress, Nginx virtual hosts, MySQL, PostgreSQL, Redis, Node.js, and Supervisor queue workers. Designed for local development with WSL2/Linux/macOS.","archived":false,"fork":false,"pushed_at":"2025-08-05T16:01:51.000Z","size":24,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-05T16:21:57.864Z","etag":null,"topics":["dev-environment","docker","fullstack","laravel","makefile","mysql","nginx","php","postgresql","redis","supervisor","symfony","vite","webpack","wordpress"],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","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/ArielEspinoza07.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2025-08-05T13:32:41.000Z","updated_at":"2025-08-05T13:48:47.000Z","dependencies_parsed_at":"2025-08-05T16:37:42.365Z","dependency_job_id":null,"html_url":"https://github.com/ArielEspinoza07/php-dev-stack","commit_stats":null,"previous_names":["arielespinoza07/php-dev-stack"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ArielEspinoza07/php-dev-stack","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielEspinoza07%2Fphp-dev-stack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielEspinoza07%2Fphp-dev-stack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielEspinoza07%2Fphp-dev-stack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielEspinoza07%2Fphp-dev-stack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArielEspinoza07","download_url":"https://codeload.github.com/ArielEspinoza07/php-dev-stack/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArielEspinoza07%2Fphp-dev-stack/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":269137306,"owners_count":24366552,"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-08-06T02:00:09.910Z","response_time":99,"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":["dev-environment","docker","fullstack","laravel","makefile","mysql","nginx","php","postgresql","redis","supervisor","symfony","vite","webpack","wordpress"],"created_at":"2025-08-06T19:00:23.639Z","updated_at":"2025-12-30T19:04:43.263Z","avatar_url":"https://github.com/ArielEspinoza07.png","language":"Dockerfile","readme":"# 📦 PHP Dockerized Environment with Multi-Version, Multi-Framework \u0026 Virtual Host Support\n\n\u003cp\u003e\n  \u003ca href=\"https://github.com/ArielEspinoza07/php-dev-stack/actions\"\u003e\n    \u003cimg src=\"https://github.com/ArielEspinoza07/php-dev-stack/actions/workflows/build-php.yml/badge.svg\"  alt=\"Build - PHP images\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ArielEspinoza07/php-dev-stack/actions\"\u003e\n    \u003cimg src=\"https://github.com/ArielEspinoza07/php-dev-stack/actions/workflows/ci-core.yml/badge.svg\"  alt=\"CI - Core Validation\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ArielEspinoza07/php-dev-stack/actions\"\u003e\n    \u003cimg src=\"https://github.com/ArielEspinoza07/php-dev-stack/actions/workflows/lint.yml/badge.svg\"  alt=\"Lint - Dockerfile \u0026 Makefile\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ArielEspinoza07/php-dev-stack/actions\"\u003e\n    \u003cimg src=\"https://github.com/ArielEspinoza07/php-dev-stack/actions/workflows/framework-tests.yml/badge.svg\"  alt=\"Framework - Laravel / Symfony Test\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/ArielEspinoza07/php-dev-stack/blob/main/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/license-MIT-green.svg\" alt=\"License\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nThis repository provides a robust and flexible development setup for any PHP-based project (Laravel, Symfony, WordPress,\netc.) using Docker, with full support for:\n\n- ✅ Multiple PHP versions (5.6, 7.4–8.3)\n- ✅ Virtual host management via `sites-available` / `sites-enabled`\n- ✅ Composer and Xdebug (where supported)\n- ✅ MySQL or PostgreSQL selectable per project\n- ✅ Redis support\n- ✅ Node.js support for frontend tools (Vite, Webpack, etc.)\n- ✅ Supervisor integration for queue workers\n- ✅ Centralized Makefile for streamlined DX\n\n```\n├── data/                        # Volumes (mysql, pgsql, redis)\n├── docker/\n│   ├── nginx/\n│   │   ├── nginx.conf\n│   │   ├── sites-available/    # Contains available vhosts\n│   │   └── sites-enabled/      # Contains symlinks to enabled vhosts\n│   ├── php/\n│   │   ├── entrypoint.sh\n│   │   └── [5.6 | 7.4 | 8.0 | 8.3]/ → Dockerfile + php.ini\n│   └── supervisor/\n│       └── supervisord.conf\n├── logs/                       # Logs from services (e.g., nginx)\n├── src/                        # Where your PHP projects live\n├── docker-compose.yml          # Core services (nginx, php, node, redis)\n├── docker-compose.mysql.yml    # Optional MySQL stack\n├── docker-compose.pgsql.yml    # Optional PostgreSQL stack\n├── Makefile                    # Dev command runner\n```\n\n---\n\n## 🚀 Getting Started\n\n### 1. Clone this boilerplate:\n\n```bash\ncp -r this-folder my-new-project\ncd my-new-project\ncp .env.example .env\n```\n\n### 2. Set PHP version in `.env`:\n\n```dotenv\nPHP_VERSION=8.3\n```\n\n### 3. Set database engine:\n\n```dotenv\nDB_CONNECTION=mysql# or pgsql\n```\n\n### 4. Enable a virtual host:\n\n```bash\nmake enable-site site=api.local.conf\n```\n\n### 5. Add domains to `/etc/hosts`:\n\n```plaintext\n127.0.0.1 api.local\n127.0.0.1 symfony.local\n```\n\n### 6. Start the stack:\n\n```bash\nmake up-db         # Auto-detects DB from .env\n```\n\n---\n\n## ⚙️ Useful Makefile Commands\n\n| Command                                           | Description                                  |\n|---------------------------------------------------|----------------------------------------------|\n| make up                                           | Start default stack (nginx, php, redis)      |\n| make up-mysql                                     | Start stack with MySQL                       |\n| make up-pgsql                                     | Start stack with PostgreSQL                  |\n| make up-db                                        | Detects DB from `.env` and runs accordingly  |\n| make down                                         | Stop and remove containers                   |\n| make restart                                      | Restart stack                                |\n| make switch-php version=8.2                       | Change PHP version                           |\n| make logs                                         | Tail container logs                          |\n| make bash                                         | Open shell in PHP container                  |\n| make composer-create-project project=... name=... | Run composer install                         |\n| make composer-install project=...                 | Run composer install                         |\n| make composer-update  project=...                 | Run composer update                          |\n| make composer-require project=... package=...     | Install package via Composer                 |\n| make run-php-command  project=... command=...     | Run any PHP CLI command                      |\n| make run-npm-command  project=... command=...     | Run any npm command (install, run dev, etc.) |\n| make enable-site site=...                         | Enable virtual host                          |\n| make new-site site=...                            | Create + enable new virtual host             |\n\n---\n\n## ⚠️ Windows Support\n\nThis development environment is designed for **Linux/macOS** or **Windows with WSL2**.\n\n### ✅ Recommended for Windows users\n\nTo use this setup on Windows, follow these steps:\n\n1. Install [WSL2 (Windows Subsystem for Linux)](https://learn.microsoft.com/en-us/windows/wsl/install)\n2. Install a Linux distribution (Ubuntu is recommended)\n3. Ensure Docker Desktop is installed and configured to use WSL2\n4. Open a WSL terminal and use `make` commands as usual:\n\n```bash\n   make up-db\n   make switch-php version=8.2\n   make run-php-command command=\"artisan migrate\"\n```\n\n### 🛠️ Manual fallback (if not using WSL)\n\nIf you can't use WSL2, you may run equivalent commands manually from Git Bash or CMD (limited support):\n\n```bash\ndocker compose -f docker-compose.yml -f docker-compose.mysql.yml up -d --build\ndocker exec -it php_project_php bash\ncomposer install\n```\n\n```\n⚠️ Note: Some Makefile logic (like sed, ln -sf, conditional execution) won't work on Windows without WSL2.\n```\n\nFor full compatibility, WSL2 is strongly recommended.\n\n---\n\n## 🧪 PHP Version Support\n\n| Version | Composer | Xdebug | Notes                        |\n|---------|----------|--------|------------------------------|\n| 5.6     | ❌        | ❌      | Legacy, limited              |\n| 7.4     | ✅        | ✅      | Stable, supported            |\n| 8.0+    | ✅        | ✅      | Recommended for new projects |\n\n---\n\n## 🧠 Notes\n\n* Node is available for projects using modern frontend tooling (Vite, Webpack, etc.)\n* Supervisor is integrated and can be configured via `.env` to run queue workers.\n* Redis is included and exposed for local debugging and pub/sub dev scenarios.\n* Ports for Node (e.g., Vite) are optional and can be configured dynamically.\n\n---\n\n## 📜 License\n\n[MIT License](LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farielespinoza07%2Fphp-dev-stack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farielespinoza07%2Fphp-dev-stack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farielespinoza07%2Fphp-dev-stack/lists"}