{"id":20520947,"url":"https://github.com/ryanreece/docker-lamp-version-sandbox","last_synced_at":"2026-04-07T16:31:13.920Z","repository":{"id":195105051,"uuid":"692254055","full_name":"ryanreece/Docker-LAMP-Version-Sandbox","owner":"ryanreece","description":"Docker compose framework to test multiple versions of web server infrastructure simultaneously (Apache, Nginx, PHP, MySQL)","archived":false,"fork":false,"pushed_at":"2023-10-07T07:18:02.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-06T00:26:03.465Z","etag":null,"topics":["apache","docker","docker-compose","mysql","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","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/ryanreece.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":"2023-09-15T23:37:46.000Z","updated_at":"2023-09-16T01:30:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"ae634d83-9254-4aeb-8d00-0e78f0801fdb","html_url":"https://github.com/ryanreece/Docker-LAMP-Version-Sandbox","commit_stats":null,"previous_names":["ryanreece/docker-sdlc-sandbox"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ryanreece/Docker-LAMP-Version-Sandbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanreece%2FDocker-LAMP-Version-Sandbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanreece%2FDocker-LAMP-Version-Sandbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanreece%2FDocker-LAMP-Version-Sandbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanreece%2FDocker-LAMP-Version-Sandbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ryanreece","download_url":"https://codeload.github.com/ryanreece/Docker-LAMP-Version-Sandbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ryanreece%2FDocker-LAMP-Version-Sandbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31520401,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["apache","docker","docker-compose","mysql","php"],"created_at":"2024-11-15T22:24:47.600Z","updated_at":"2026-04-07T16:31:13.899Z","avatar_url":"https://github.com/ryanreece.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Docker LAMP Version Sandbox\n\nA Docker Compose framework designed to make it simple to test different versions of Apache, PHP, and MySQL. Whether you are looking to perform major version upgrades or simply need to test your app against various software stacks, this repo might be able to help. With easy-to-use configuration files, you can simultaneously switch between multiple software versions to ensure your application runs smoothly under any setup.\n\nFor a more detailed review of the functionality of this repo as well as the inspiration, [check out my blog post](https://reece.ai/docs/devnetops/docker/docker-lamp-version-sandbox).\n\n## Default Containers\n1. Nginx Load Balancer - Latest Version\n2. Apache PHP - Latest Version\n3. Apache PHP - v7.4.33\n4. MySQL - Latest Version\n5. PHPMyAdmin for MySQL - Latest Version\n6. MySQL - v5.7.43\n7. PHPMyAdmin for MySQL - v5.7.43\n\n## Dependencies\n1. Docker and Supported OS\n- [Docker for Windows](https://docs.docker.com/desktop/install/windows-install/)\n- [Docker for MacOS](https://docs.docker.com/desktop/install/mac-install/)\n- [Docker for Ubuntu](https://docs.docker.com/engine/install/ubuntu/)\n\n## Running\n\n1. On the docker host\n\nStarting containers:\n```bash\n$ docker compose up -d\n```\n\nViewing containers:\n```bash\n$ docker ps\n```\n\nStopping containers:\n```bash\n$ docker compose down\n```\n\n2. Accessing Resources\n\nWeb URLs:\n- [localhost:8080](http://localhost:8080) - Apache PHP v8.2.x\n- [localhost:8081](http://localhost:8081) - Apache PHP v7.4.33\n- [localhost:8090](http://localhost:8090) - PHPMyAdmin for MySQL v8.1.x\n- [localhost:8091](http://localhost:8091) - PHPMyAdmin for MySQL v5.7.43\n\nMySQL:\n```bash\n$ mysql --host=localhost --port=3380 --user=root -p --protocol=tcp\n$ mysql --host=localhost --port=3381 --user=root -p --protocol=tcp\n```\n\nMySQL Database Import Example:\n```bash\n$ mysql --host=localhost --port=3381 --user=root -p --protocol=tcp DATABASE_NAME \u003c FILE.sql\n```\n\nMySQL Database Dump Example:\n```bash\n$ mysqldump --host=localhost --port=3381 --user=root -p --protocol=tcp DATABASE_NAME \u003e FILE.sql\n```\n\n## Testing Your App\n- Place PHP source code into the following versioned directories:\n\n### Apache PHP Latest\n```\n$ apache-php-latest/src/\n```\n\n### Apache PHP 7.4.33\n```\n$ apache-php-7.4.33/src/\n```\n\n## MySQL Databases\n- Update database connection strings to `db` and `db_legacy` to test between MySQL containers.\n\n### Example MySQL Connection with PHP\n\nUsing the `db_legacy` container running MySQL 5.7:\n```php\n\u003c?php\n// MySQL Server Host\n// 'db_legacy' is the Docker Compose service name for MySQL\n$host = 'db_legacy';\n\n// MySQL Root Password\n// Same as MYSQL_ROOT_PASSWORD in docker-compose.yml\n$rootPassword = 'mysql-root-sdlc';\n\n// Connect to MySQL server with root credentials\n$rootPdo = new PDO(\"mysql:host=$host\", 'root', $rootPassword);\n```\n\n### MySQL Data Volumes\n\nMySQL data is stored in docker volumes defined in the `compose.yml` file. \n```yaml\nvolumes:\n  db_data:\n  db_legacy_data:\n```\n\nVolumes can be listed using the docker cli and are preserved between container creations and destroys.\n```bash\n$ docker volume ls\nlocal     docker-lamp-version-sandbox_db_data\nlocal     docker-lamp-version-sandbox_db_legacy_data\n```\n\n### Docker Images\n\nView images:\n```bash\n$ docker image ls\nREPOSITORY          TAG       IMAGE ID       CREATED       SIZE\nnginx-latest        latest    a2bc4287970f   3 hours ago   187MB\napache-php-7.4.33   latest    4c2c4df02190   2 days ago    479MB\napache-php-latest   latest    a93bcf0730b4   3 days ago    531MB\nphpmyadmin          latest    b5821d22d3db   8 days ago    562MB\nmysql               latest    99afc808f15b   5 weeks ago   577MB\nmysql-latest        latest    e645c1e8d39e   5 weeks ago   577MB\nmysql-5.7           latest    3e51c56d1e0b   6 weeks ago   581MB\n```\n\nDelete specific image:\n```bash\n$ docker image rm IMAGE_NAME\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanreece%2Fdocker-lamp-version-sandbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryanreece%2Fdocker-lamp-version-sandbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryanreece%2Fdocker-lamp-version-sandbox/lists"}