{"id":29016424,"url":"https://github.com/devopsterminal/local-subdomains","last_synced_at":"2026-01-20T16:27:27.720Z","repository":{"id":300634578,"uuid":"1006657516","full_name":"DevOpsTerminal/local-subdomains","owner":"DevOpsTerminal","description":"This project sets up a local development environment with multiple subdomains using Traefik as a reverse proxy and vcap.me for local domain resolution.","archived":false,"fork":false,"pushed_at":"2025-06-22T19:50:05.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-22T20:35:28.821Z","etag":null,"topics":["caddy","docker","example","hosts","localhost","nginx","proxy","traefik"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/DevOpsTerminal.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-06-22T18:27:46.000Z","updated_at":"2025-06-22T19:50:08.000Z","dependencies_parsed_at":"2025-06-22T20:35:36.295Z","dependency_job_id":null,"html_url":"https://github.com/DevOpsTerminal/local-subdomains","commit_stats":null,"previous_names":["devopsterminal/local-subdomains"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DevOpsTerminal/local-subdomains","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevOpsTerminal%2Flocal-subdomains","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevOpsTerminal%2Flocal-subdomains/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevOpsTerminal%2Flocal-subdomains/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevOpsTerminal%2Flocal-subdomains/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevOpsTerminal","download_url":"https://codeload.github.com/DevOpsTerminal/local-subdomains/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevOpsTerminal%2Flocal-subdomains/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268554909,"owners_count":24269062,"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-03T02:00:12.545Z","response_time":2577,"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":["caddy","docker","example","hosts","localhost","nginx","proxy","traefik"],"created_at":"2025-06-25T22:08:17.628Z","updated_at":"2025-09-15T18:35:36.150Z","avatar_url":"https://github.com/DevOpsTerminal.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Local Development with Subdomains using Traefik and vcap.me\n\nThis project sets up a local development environment with multiple subdomains using Traefik as a reverse proxy and vcap.me for local domain resolution.\n\n## Features\n\n- Local development with subdomains (e.g., app1.vcap.me, app2.vcap.me)\n- Easy switching between development and production environments\n- Automatic SSL certificate management (when configured for production)\n- Simple Makefile commands for common tasks\n\n## Prerequisites\n\n- Docker and Docker Compose installed\n- Make utility (usually pre-installed on Linux/macOS)\n\n## Getting Started\n\n1. Clone this repository\n2. Start the development environment:\n   ```bash\n   make dev\n   ```\n3. Access your services at:\n   - http://app1.vcap.me\n   - http://app2.vcap.me\n\n## Environment Management\n\n- `make dev` - Start development environment (uses .env.dev)\n- `make prod` - Start production environment (uses .env.prod)\n- `make stop` - Stop all services\n- `make status` - Check service status\n\n## Configuration\n\n- `.env.dev` - Development environment variables\n- `.env.prod` - Production environment variables\n- `docker-compose.yml` - Main Docker Compose configuration\n\n## Adding New Services\n\n1. Add a new service to `docker-compose.yml`\n2. Add the appropriate Traefik labels for routing\n3. Update the environment files with the new domain\n4. Restart the services\n\n## Testing with Ansible\n\nThis project includes Ansible tests to verify the subdomain configuration. The tests check if all configured subdomains are accessible and return the expected HTTP status code.\n\n### Prerequisites\n\n- Ansible 2.9 or later\n- Python 3.6 or later\n\n### Running Tests\n\n1. Install the test dependencies:\n   ```bash\n   pip install -r tests/ansible/requirements.txt\n   ```\n\n2. Make sure your services are running:\n   ```bash\n   make dev\n   ```\n\n3. Run the Ansible tests:\n   ```bash\n   cd tests/ansible\n   ansible-playbook playbook.yml\n   ```\n\n### Test Configuration\n\nYou can modify the test configuration in `tests/ansible/playbook.yml`:\n\n```yaml\nvars:\n  test_domains:\n    - \"app1.vcap.me\"\n    - \"app2.vcap.me\"\n  expected_status: 200\n```\n\n## Troubleshooting\n\n### Domain Resolution Issues\n\nIf domains don't resolve, try these solutions:\n\n1. **For vcap.me/localhost resolution issues**:\n   - Ensure your `/etc/hosts` includes:\n     ```\n     127.0.0.1 app1.vcap.me app2.vcap.me\n     ```\n\n2. **DNS Rebinding Protection**:\n   If your network blocks resolving domains like vcap.me:\n   - Check your router settings for \"DNS rebinding protection\" and disable it if needed\n   - Try using alternative DNS servers like Cloudflare (1.1.1.1) or Google DNS (8.8.8.8)\n   - Configure a custom domain with a wildcard A record pointing to 127.0.0.1\n\n3. **Service Logs**:\n   ```bash\n   docker-compose logs \u003cservice_name\u003e\n   ```\n\n## Recommended Approach\n\nFor the best development experience, we recommend using `localtest.me` with environment variables because:\n\n✅ **No docker-compose.yml modifications needed** - All changes are in `.env` files  \n✅ **No hosts file editing required** - localtest.me works out of the box  \n✅ **Identical domain structure** - Use the same URL structure across environments  \n✅ **Quick setup** - Just update the `.env` file  \n✅ **Subdomain support** - Wildcard subdomains work automatically\n\n### Usage Example:\n\n```bash\n# Development\ncp .env.dev .env\ndocker-compose up -d\n\n# Production  \ncp .env.prod .env\ndocker-compose up -d\n```\n\nThis approach offers maximum flexibility with minimal configuration complexity and requires no modifications to the main `docker-compose.yml` file.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevopsterminal%2Flocal-subdomains","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevopsterminal%2Flocal-subdomains","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevopsterminal%2Flocal-subdomains/lists"}