{"id":20284868,"url":"https://github.com/sourceability/docker-dev-load-balancer","last_synced_at":"2026-03-19T15:04:06.394Z","repository":{"id":102100369,"uuid":"149531581","full_name":"sourceability/docker-dev-load-balancer","owner":"sourceability","description":null,"archived":false,"fork":false,"pushed_at":"2020-04-11T17:17:03.000Z","size":3,"stargazers_count":3,"open_issues_count":2,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T03:43:39.694Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/sourceability.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":"2018-09-20T01:07:37.000Z","updated_at":"2023-06-02T17:53:37.000Z","dependencies_parsed_at":"2023-06-03T13:20:56.069Z","dependency_job_id":null,"html_url":"https://github.com/sourceability/docker-dev-load-balancer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sourceability/docker-dev-load-balancer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceability%2Fdocker-dev-load-balancer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceability%2Fdocker-dev-load-balancer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceability%2Fdocker-dev-load-balancer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceability%2Fdocker-dev-load-balancer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sourceability","download_url":"https://codeload.github.com/sourceability/docker-dev-load-balancer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sourceability%2Fdocker-dev-load-balancer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273917882,"owners_count":25190937,"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-09-06T02:00:13.247Z","response_time":2576,"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":[],"created_at":"2024-11-14T14:22:36.770Z","updated_at":"2026-02-12T03:41:15.941Z","avatar_url":"https://github.com/sourceability.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Local load balancer for docker-compose projects\n\nThis project allows to access individual docker compose containers through `http://(.+\\.)?\u003cservice\u003e.\u003ccompose-project\u003e.docker`.\n\nThis is how it works:\n- A docker container runs a dns server that always returns 127.0.0.1 (exposed to localhost:10053)\n- The system needs to be configured to resolve any .docker hostname with localhost:10053\n- A docker container runs an nginx load balancer exposed on localhost:80 that proxies `*\u003cservice\u003e.\u003ccompose-project\u003e.docker`\n  http requests to `\u003ccompose-project\u003e_\u003cservice\u003e_1`. This container is attached to all the docker networks.\n\nThe containers will start when docker starts since they are configured with `restart: always`.\n\n## Installation\n\n```\n# Start load balancer and dns\ndocker-compose up -d\n\n# Give load balancer access to all the compose networks\ndocker network ls --filter driver=bridge --filter scope=local -q \\\n    | xargs -I {} docker network connect {} \"$(docker-compose ps -q lb)\"\n\n# Configure system to resolve all .docker domains using the spun up dns server\nsudo mkdir -p /etc/resolver\nsudo tee /etc/resolver/docker \u003e /dev/null \u003c\u003cEOF\ndomain docker\nport 10053\nnameserver 127.0.0.1\nEOF\n```\n\n## Adding networks\n\nWhenever you've started a new docker compose project or added networks, run the same command that you ran during installation:\n\n```\ndocker network ls --filter driver=bridge --filter scope=local -q \\\n    | xargs -I {} docker network connect {} \"$(docker-compose ps -q lb)\"\n```\n\n## Removing networks\n\nIf you need to disconnect the load balancer from a network, for example when running `docker-compose down` for that network/project:\n\n```\ndocker network disconnect -f \u003ccompose-project\u003e_default \"$(docker-compose ps -q lb)\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourceability%2Fdocker-dev-load-balancer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsourceability%2Fdocker-dev-load-balancer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsourceability%2Fdocker-dev-load-balancer/lists"}