{"id":26499713,"url":"https://github.com/cockroachlabs-field/dynamic-haproxy","last_synced_at":"2025-03-20T15:18:50.817Z","repository":{"id":63769724,"uuid":"261308276","full_name":"cockroachlabs-field/dynamic-haproxy","owner":"cockroachlabs-field","description":"A Docker image that simplifies the deployment of HAProxy in front of a CockroachDB Docker cluster.","archived":false,"fork":false,"pushed_at":"2022-12-24T22:00:34.000Z","size":18,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-01-28T17:10:08.842Z","etag":null,"topics":["cockroachdb","docker","docker-compose","haproxy"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/cockroachlabs-field.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}},"created_at":"2020-05-04T22:21:31.000Z","updated_at":"2024-01-28T17:10:08.843Z","dependencies_parsed_at":"2023-01-30T21:15:17.509Z","dependency_job_id":null,"html_url":"https://github.com/cockroachlabs-field/dynamic-haproxy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fdynamic-haproxy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fdynamic-haproxy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fdynamic-haproxy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cockroachlabs-field%2Fdynamic-haproxy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cockroachlabs-field","download_url":"https://codeload.github.com/cockroachlabs-field/dynamic-haproxy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244637102,"owners_count":20485446,"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":["cockroachdb","docker","docker-compose","haproxy"],"created_at":"2025-03-20T15:18:50.264Z","updated_at":"2025-03-20T15:18:50.808Z","avatar_url":"https://github.com/cockroachlabs-field.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CockroachDB Dynamic HAProxy\nA Docker image that simplifies the deployment of HAProxy in front of a CockroachDB Docker cluster.  This image is intended to be used for local development, testing and demos.  The following `docker-compose.yml` snippet highlights how it may be used, specifically the `lb` service. \n\n```yaml\nservices:\n\n  crdb-0:\n    hostname: crdb-0\n    ...\n\n  crdb-1:\n    hostname: crdb-1\n    ...\n\n  crdb-2:\n    hostname: crdb-2\n    ...\n\n  lb:\n    container_name: lb\n    hostname: lb\n    image: timveil/dynamic-haproxy:latest\n    ports:\n      - \"26257:26257\" # SQL Port\n      - \"8080:8080\"   # HTTP Port\n      - \"8081:8081\"   # Stats Port\n    environment:\n      - NODES=crdb-0 crdb-1 crdb-2\n    links:\n      - crdb-0\n      - crdb-1\n      - crdb-2\n```\n\nThe following `environment` variables are supported by the Docker image.\n* `NODES` - __Required__. A space-delimited list of CockroachDB node hostnames (as defined above in `docker-compose.yml`) that will be fronted by HAProxy.  For example, `crdb-0 crdb-1 crdb-2`.\n* `SQL_BIND_PORT` - The port that HAProxy will `bind` and ultimately expose for CockroachDB SQL connections.  The default is `26257`.\n* `HTTP_BIND_PORT` - The port that HAProxy will `bind` and ultimately expose for CockroachDB HTTP connections.  The default is `8080`.\n* `STATS_BIND_PORT` - The port that HAProxy will `bind` and ultimately expose for the HAProxy Statistics Report UI.  The default is `8081`.\n* `SQL_LISTEN_PORT` - The port that the CockroachDB exposes for SQL connections.  The default is `26257`.\n* `HTTP_LISTEN_PORT` - The port that the CockroachDB exposes for HTTP connections.  The default is `8080`.\n* `HEALTH_CHECK_PORT` - The port that the CockroachDB uses for health checks.  The default is `8080`.\n\n## Building the Image\n```bash\ndocker build --no-cache -t timveil/dynamic-haproxy:latest .\n```\n\n## Publishing the Image\n```bash\ndocker push timveil/dynamic-haproxy:latest\n```\n\n## Running the Image\n```bash\ndocker run -it timveil/dynamic-haproxy:latest\n```\n\nrunning the image with environment variables\n```bash\ndocker run \\\n    --env \"NODES=crdb-0 crdb-1 crdb-2\" \\\n    --env SQL_BIND_PORT=5432 \\\n    -it timveil/dynamic-haproxy:latest\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachlabs-field%2Fdynamic-haproxy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcockroachlabs-field%2Fdynamic-haproxy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcockroachlabs-field%2Fdynamic-haproxy/lists"}