{"id":15090219,"url":"https://github.com/rpstreef/flexible-dev-environment","last_synced_at":"2026-01-03T23:48:39.150Z","repository":{"id":244879244,"uuid":"816547224","full_name":"rpstreef/flexible-dev-environment","owner":"rpstreef","description":"Docker compose example with Apache 2 as a reverse proxy ","archived":false,"fork":false,"pushed_at":"2024-06-25T11:55:09.000Z","size":41,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T11:43:13.386Z","etag":null,"topics":["apache2","docker","docker-compose","gateway","vagrant","vagrantfile","virtualbox"],"latest_commit_sha":null,"homepage":"https://rolfstreefkerk.com/article/how-to-create-a-flexible-dev-environment-with-vagrant-and-docker","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rpstreef.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}},"created_at":"2024-06-18T01:08:34.000Z","updated_at":"2024-06-25T11:55:36.000Z","dependencies_parsed_at":"2024-06-25T12:00:46.776Z","dependency_job_id":"4e9128d5-e2b2-4795-8bb2-e1c428aeb3df","html_url":"https://github.com/rpstreef/flexible-dev-environment","commit_stats":null,"previous_names":["rpstreef/docker-apache-reverse-proxy","rpstreef/flexible-dev-environment"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpstreef%2Fflexible-dev-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpstreef%2Fflexible-dev-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpstreef%2Fflexible-dev-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rpstreef%2Fflexible-dev-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rpstreef","download_url":"https://codeload.github.com/rpstreef/flexible-dev-environment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244826693,"owners_count":20516806,"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","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":["apache2","docker","docker-compose","gateway","vagrant","vagrantfile","virtualbox"],"created_at":"2024-09-25T09:23:40.311Z","updated_at":"2026-01-03T23:48:39.116Z","avatar_url":"https://github.com/rpstreef.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Flexible Development Environment\n\n[![License: Apache 2](https://img.shields.io/github/license/saltstack/salt)](https://opensource.org/license/apache-2-0)\n\nA versatile, fully automated virtualized development environment. This setup leverages Vagrant, VirtualBox, and Docker to create a consistent, easily reproducible, and highly adaptable development infrastructure.\n\n\u003e See this [article](https://rolfstreefkerk.com/article/how-to-create-a-flexible-dev-environment-with-vagrant-and-docker) for more details and a full walkthrough of this setup.\n\n## Features\n\n- **Flexible Infrastructure**: Easily customizable for various tech stacks\n- **Fully Automated Setup**: Get up and running with a single command\n- **Virtualized Environment**: Runs on VirtualBox, managed by Vagrant\n- **Containerized Services**: Uses Docker Compose for easy service management and scalability\n\n### Example Configuration\n\nThis repository includes an example setup for a PHP/Laravel environment, demonstrating how to configure:\n\n- Apache as a Gateway\n- PHP with Apache for front-end\n- Laravel API\n- Redis Cache with Redis Commander\n- MySQL database with PHPMyAdmin\n\nHowever, the infrastructure is designed to be easily adapted for other tech stacks and services.\n\n## Prerequisites\n\n- [VirtualBox](https://www.virtualbox.org/)\n- [Vagrant](https://www.vagrantup.com/)\n- [Git](https://git-scm.com/)\n\n## Quick Start\n1. Clone this repository: git clone https://github.com/yourusername/flexible-dev-environment.git\n2. Navigate to the project directory: cd flexible-dev-environment\n3. Start the Vagrant environment: `vagrant up` to install with Vagrant to VirtualBox.\n4. Select network card with internet access.\n5. Once installed, connect with `vagrant ssh`, for ssh access.\n6. Type `ip address` take note of the \u003cip address\u003e for your network card.\n7. Now you can access your services via the browser with your \u003cip address\u003e (using the PHP/Laravel as example):\n- Front-end: `http://\u003cip address\u003e/`\n- API: `http://\u003cip address\u003e/api/`\n- Redis Commander: `http://\u003cip address\u003e/cache/`\n- PHPMyAdmin: `http://\u003cip address\u003e/phpmyadmin/`\n\n## Customizing Your Environment\n\nThis setup can be easily adapted for different tech stacks:\n\n1. Modify the `docker-compose.yml` file to include your required services\n2. Update the `Vagrantfile` if you need to change VM configurations and Ubuntu installations and dependencies.\n\n## (Optional) Makefile for quick access\n\nEnter `make' for this help list:\n\n```bash\n@echo 'make install\t\t\t\t- Install VirtualMachine with Docker and LangFlow'\n@echo 'make update\t\t\t\t- Update the Vagrant VirtualMachine'\n@echo 'make remove\t\t\t\t- Remove this VirtualMachine'\n@echo 'make vm\t\t\t\t\t- Connect to VirtualBox via SSH and (if required) starts VirtualBox first'\n@echo 'make vm-stop\t\t\t\t- Stops VirtualBox'\n@echo 'make up\t\t\t\t\t- Docker containers build (if required) and up as a daemon (in the background)'\n@echo 'make down\t\t\t\t- Docker containers down'\n```\n\n# A few notes about this setup\n\n## .env files for configuration\n\nNormally, you would not commit the `.env` file due to passwords etc. \n\nThis project requires the follwing configuration in the root directory of this git repo:\n\n```bash\n# MySQL\nMYSQL_ROOT_PASSWORD=root_password\nMYSQL_DATABASE=my_database\nMYSQL_USER=my_user\nMYSQL_PASSWORD=my_password\n\n# Redis Commander\nREDIS_HOST=redis\nREDIS_PORT=6379\nREDIS_NAME=local\nREDIS_PASSWORD=\n\n# Laravel\nAPP_KEY=base64:ezEe4jH/6EUM2fMWLnco3kuMz1OMStq/XfV456ZwMhc=\n\n# User config\nUID=1000\nGID=1000\n```\n\n## Host machine user and group id\n\nEnsure the API Laravel service runs on the same user id and group id as your host system!\n\nThis will avoid disk permission and ownership problems when sharing files between a container and the host machine.\n\n```shell\nAPACHE_RUN_USER: \"#${UID}\"\nAPACHE_RUN_GROUP: \"#${GID}\"\n```\n\n## PHPMyAdmin\n\nEnsure `PMA_ABSOLUTE_URI` configuration matches the forwarding rule such that after login the path remains e.g. `localhost/phpmyadmin/index.php?`\n\n# Troubleshooting\n\n## Connectivity issues?\n\nIn case you want to troubleshoot from a specific container, do the following:\n\nIf it's the `gateway` container:\n\n```bash\ndocker exec -it gateway bash\napt-get update\napt-get install -y curl iputils-ping\n```\n\nNow you can check the connectivity to other services with;\n\n```bash\nping phpmyadmin\ncurl -I http://phpmyadmin:80\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n## License\n\nThis project is licensed under the Apache 2.0 License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpstreef%2Fflexible-dev-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frpstreef%2Fflexible-dev-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frpstreef%2Fflexible-dev-environment/lists"}