{"id":13697126,"url":"https://github.com/pvtl/docker-dev","last_synced_at":"2026-02-18T03:10:15.765Z","repository":{"id":29663679,"uuid":"122410101","full_name":"pvtl/docker-dev","owner":"pvtl","description":"A local Docker Environment for building PHP applications 🔨","archived":false,"fork":false,"pushed_at":"2026-01-23T01:46:10.000Z","size":737,"stargazers_count":123,"open_issues_count":0,"forks_count":35,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-01-23T15:36:30.311Z","etag":null,"topics":["developer-tools","development-environment","development-tools","docker","docker-compose","lamp","lamp-server"],"latest_commit_sha":null,"homepage":null,"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/pvtl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-02-22T00:11:34.000Z","updated_at":"2026-01-23T01:46:13.000Z","dependencies_parsed_at":"2023-02-13T18:31:19.623Z","dependency_job_id":"ccfdc972-8848-4c2d-be94-01fc80de706a","html_url":"https://github.com/pvtl/docker-dev","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/pvtl/docker-dev","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvtl%2Fdocker-dev","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvtl%2Fdocker-dev/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvtl%2Fdocker-dev/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvtl%2Fdocker-dev/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pvtl","download_url":"https://codeload.github.com/pvtl/docker-dev/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pvtl%2Fdocker-dev/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29566742,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-18T00:47:08.760Z","status":"online","status_checked_at":"2026-02-18T02:00:09.468Z","response_time":162,"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":["developer-tools","development-environment","development-tools","docker","docker-compose","lamp","lamp-server"],"created_at":"2024-08-02T18:00:52.863Z","updated_at":"2026-02-18T03:10:10.756Z","avatar_url":"https://github.com/pvtl.png","language":"Dockerfile","readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"docs/logo.jpg\" alt=\"LAMP LDE\" style=\"width:100%\" /\u003e\n  \u003cp\u003e\u003c/p\u003e\n  \u003ch1\u003eLAMP Local Development Environment on Docker\u003c/h1\u003e\n  \u003cp\u003e\u003c/p\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ca href=\"#-intro\"\u003e\u003cb\u003eWhat is this?\u003c/b\u003e\u003c/a\u003e\n    \u0026nbsp;\u0026nbsp;\u0026mdash;\u0026nbsp;\u0026nbsp;\n    \u003ca href=\"#installation-\"\u003e\u003cb\u003eInstallation\u003c/b\u003e\u003c/a\u003e\n    \u0026nbsp;\u0026nbsp;\u0026mdash;\u0026nbsp;\u0026nbsp;\n    \u003ca href=\"#common-commands-\"\u003e\u003cb\u003eUsage\u003c/b\u003e\u003c/a\u003e\n    \u0026nbsp;\u0026nbsp;\u0026mdash;\u0026nbsp;\u0026nbsp;\n    \u003ca href=\"#helpful-info\"\u003e\u003cb\u003eDocs\u003c/b\u003e\u003c/a\u003e\n  \u003c/p\u003e\n  \u003cbr /\u003e\n\u003c/div\u003e\n\n__An everyday local development environment for PHP Developers.__ At [Pivotal Agency](https://www.pivotalagency.com.au/), we've done a _buuunnnch_ of R\u0026D to find the best local dev tools for our team. This is the result of our hard work. This tool has been put to its paces everyday by our team, we hope it can also help yours.\n\n\n## Intro 👋\n\nThis is a set of Docker images to spin up a LAMP stack (Linux, Apache, MySQL and PHP) for developing locally. It's perfect for local development because you can very simply add new sites to specified folder and they're magically accessible as a subdomain of your chosen hostname (eg. `~/Projects/example` maps to `http://example.localhost/`).\n\nIt includes all the required dependencies for everyday PHP development with common tools like Laravel, Wordpress and Magento (1 \u0026 2). Specifically:\n\n**Default Services**\n\n- Apache (including HTTPS)\n- PHP 8.4\n    - Composer (latest)\n    - Node.js (latest LTS) \u0026 NPM (latest)*\n    - Yarn (latest of 1.x)*\n    - PHPCS (with Wordpress code standards added)*\n    - Wordpress CLI*\n    - ZSH*\n- Mailpit\n- MariaDB 11.4 LTS\n\n\u003cp\u003e\u003ci\u003e* Available in latest PHP container\u003c/i\u003e\u003c/p\u003e\n\n**Optional Services**\n\n- PHP 5.6, all 7.x and all 8.x\n- Memcached 1.x\n- Valkey 8.x (the open source fork of Redis)\n- [Blackfire](https://blackfire.io/) (latest)\n\nThese optional services (eg. PHP 7.4) can be enabled by adding them to the `COMPOSE_FILE` list in `.env`. See the `.env` file for examples. Make sure you run `docker compose up -d --remove-orphans` after making changes to the `.env` file.\n\n\n## Prerequisites ⚠️\n\nYou'll need to install a modern version of Docker Desktop (or Docker on Linux).\n\n\n## Domain Mapping 🗺\n\nYou can tell Docker Dev which version of PHP to use or whether it should load code from a \"public\" folder (required for Laravel, WordPress Bedrock and Magento) simply by adjusting your project's URL.\n\nIt's assumed that all of your projects are stored as folders in `~/Projects/`. You can use a different folder by changing the `DOCUMENTROOT` variable in your `.env` file.\n\nHere is the the simplest form of domain mapping:\n\n- `https://\u003cfolder\u003e.localhost` will use the latest version of PHP and load the code from `~/Projects/\u003cfolder\u003e/`\n\nPlease note that PHP is upgraded yearly. If you want to use a specific version of PHP, you can specify it in the URL:\n\n* `https://\u003cfolder\u003e.php84.localhost` will use PHP 8.4\n\nOr, if you want the code loaded from the \"public\" folder:\n\n* `https://\u003cfolder\u003e.pub.localhost` will use latest version of PHP and load the code from `~/Projects/\u003cfolder\u003e/public/`\n\nLastly, you can combine the two:\n\n* `https://\u003cfolder\u003e.php84.pub.localhost` will use PHP 8.4 and load the code from `~/Projects/\u003cfolder\u003e/public/`\n\nSome frameworks use a different public folder name (eg. [Wordpress Bedrock](https://roots.io/bedrock/) uses \"web\"). In these instances we recommend adding a symlink to the public folder:\n\n```bash\ncd ~/Projects/\u003cfolder\u003e/\nln -s web public\n```\n\n\n## Installation 🚀\n\n\u003e Windows Users: The Docker Dev containers perform best while running inside WSL2. We'll assume your Project folder will be stored inside WSL2, and that you will run these commands in a WSL2 terminal (eg. Ubuntu LTS).\n\n1. Open a terminal window\n2. Create a new folder for your projects\n```\nmkdir ~/Projects\ncd ~/Projects\n```\n**Note**: The `~/` alias points to your home folder (eg. `/home/USERNAME/`)\n\n3. Clone this repo into your projects folder\n```\ngit clone git@github.com:pvtl/docker-dev.git\ncd docker-dev\n```\n4. Copy `.env.example` to `.env` and set `DOCUMENTROOT` to your projects folder (eg. `~/Projects/`)\n5. Build and start the Docker containers:\n```\ndocker compose up -d\n```\n\nFor ease of use we recommend you set up the [Daily Shortcuts](https://github.com/pvtl/docker-dev/#daily-shortcuts-%EF%B8%8F).\n\nConfirm your Docker Dev environment is working correctly using a simple PHP Info file.\n\n1. Create the folder and file: `~/Projects/test/index.php`\n1. Edit the file and paste `\u003c?php phpinfo();`\n1. In your browser, open https://test.localhost. You should see the PHP Info page.\n\n\n## Updating 🔄\n\n\u003e Don't worry, your project files and databases live outside of Docker and will be KEPT AS-IS if you follow this update process.\n\nWe regularly update this Github project and Docker images with the latest versions of PHP, Apache, MySQL etc.\n\nTo install those latest updates, open a terminal window, browse to the `docker-dev` folder and run:\n\n```bash\n# 1. Fetch our latest updates\ngit pull\n\n# 2. Erase previous containers\ndocker compose down --remove-orphans\n\n# 3. Erase unused Docker builder resources\ndocker builder prune\n\n# 4. Get latest images from Docker Hub\ndocker compose pull\n\n# 5. Rebuild Dockerfiles from scratch (inc. pull any parent images)\ndocker compose build --pull --no-cache --parallel\n\n# 6. Start the updated environment\ndocker compose up -d --remove-orphans\n\n# 7. Erase any unused containers, images, volumes etc. to free disk space.\ndocker system prune --volumes\n```\n\n\n## Daily Shortcuts ⚡️\n\nTo make your life easier, we recommend setting up aliases in your terminal. You can then start and stop your Docker Dev environment, or jump into a PHP container, with a single command.\n\nIf you use ZSH, edit `~/.zshrc`. Otherwise edit `~/.bashrc`. You may need to create the file if it doesn't exist.\n\n1. Paste the code (below) at the bottom of the file\n1. Adjust your folder path to suit\n1. Close and re-open your terminal to apply the changes\n1. Try running `devup`, `devdown` or `devin 84`\n\n```\n# Usage: \"devup\" or \"devdown\"\nalias devup='(cd /home/USERNAME/Projects/docker-dev \u0026\u0026 docker compose start)'\nalias devdown='(cd /home/USERNAME/Projects/docker-dev \u0026\u0026 docker compose stop)'\n\n# Usage (for PHP 8.4): \"devin 84\"\n# Simply change the numbers for your preferred PHP version (assuming it's installed/enabled)\ndevin() {\n    # Use zsh for PHP 8 and above\n    if [[ \"${1:0:1}\" -ge \"8\" ]]; then\n        docker exec -it php$1 zsh\n    else\n        docker exec -it php$1 bash\n    fi\n}\n```\n\n\n## Other Actions 🔥\n\nFor those who use Windows or macOS and prefer desktop apps, most of these actions can be done in Docker Desktop. Read on if you prefer using the CLI.\n\nDocker must be running and these commands must be run while inside the Docker Dev folder (eg. `cd ~/Projects/docker-dev`).\n\n| Command | Description |\n|---|---|\n| `docker compose start` | Start all containers |\n| `docker compose stop`  | Stop all containers (keeps any config changes you've made to the containers) |\n| `docker compose up -d --build --no-cache` | Recreate all containers from scratch |\n| `docker compose down --remove-orphans`  | Tear down all containers (MySQL data and project folders are kept) |\n| `docker compose exec php84-fpm zsh`  | Open a zsh terminal in the PHP 8.4 container |\n| `docker compose logs php84-fpm` | View all logs for PHP-FPM 8.4 |\n| `docker compose ps` | Show which containers are running |\n\n\n## Helpful Info 🤓\n\n- [General FAQ's](docs/general-faq.md)\n- [Apache Web Server](docs/apache-web-server.md)\n- [PHP](docs/php.md)\n    - [PCOV](docs/pcov.md)\n    - [Blackfire PHP Profiler](docs/blackfire-php-profiler.md)\n    - [Xdebug](docs/xdebug.md)\n- [MariaDB / MySQL Database](docs/mariadb-database.md)\n- [Mailpit (Email Testing)](docs/mailpit-smtp.md)\n- [Node.js](docs/nodejs.md)\n- [Valkey (the open source fork of Redis)](docs/valkey.md)\n- [Memcached](docs/memcached.md)\n","funding_links":[],"categories":["Dockerfile"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvtl%2Fdocker-dev","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpvtl%2Fdocker-dev","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpvtl%2Fdocker-dev/lists"}