{"id":15707342,"url":"https://github.com/colinmollenhour/haproxy-service","last_synced_at":"2026-02-21T21:04:46.460Z","repository":{"id":50284487,"uuid":"70624698","full_name":"colinmollenhour/haproxy-service","owner":"colinmollenhour","description":"A Docker container for HAProxy with auto-updating config based on DNS resolution (Docker Swarm, Kontena, etc).","archived":false,"fork":false,"pushed_at":"2022-08-02T17:18:04.000Z","size":19,"stargazers_count":3,"open_issues_count":0,"forks_count":6,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-12-23T15:35:00.074Z","etag":null,"topics":["dns","docker-image","haproxy","load-balancer"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/colinmollenhour/haproxy-service/","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/colinmollenhour.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":"2016-10-11T18:44:05.000Z","updated_at":"2022-07-28T02:41:07.000Z","dependencies_parsed_at":"2022-08-25T18:01:57.080Z","dependency_job_id":null,"html_url":"https://github.com/colinmollenhour/haproxy-service","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/colinmollenhour/haproxy-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinmollenhour%2Fhaproxy-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinmollenhour%2Fhaproxy-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinmollenhour%2Fhaproxy-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinmollenhour%2Fhaproxy-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/colinmollenhour","download_url":"https://codeload.github.com/colinmollenhour/haproxy-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/colinmollenhour%2Fhaproxy-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29694118,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T18:18:25.093Z","status":"ssl_error","status_checked_at":"2026-02-21T18:18:22.435Z","response_time":107,"last_error":"SSL_read: 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":["dns","docker-image","haproxy","load-balancer"],"created_at":"2024-10-03T20:40:17.279Z","updated_at":"2026-02-21T21:04:46.432Z","avatar_url":"https://github.com/colinmollenhour.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HAProxy Service Load Balancer\n\nThis container updates an HAProxy config template periodically using the results of DNS resolution\nto trigger the update and apply the template and reload HAProxy.\n\n## Usage\n\nYou can either run this container directly by mounting a template file at /etc/haproxy.cfg.tpl\nor by copying and baking the template file in using a new Dockerfile. Either way it requires\nan environment variable `SERVICE_HOSTNAME` which is the DNS name to resolve when updating the template.\nMultiple DNS hostnames may be specified separated by commas.\n\n#### Logging\n\nHAProxy 1.9+ supports direct to stdout/stderr logging so rsyslog was removed.\n\n#### User\n\nThis container runs as `root` rather than `haproxy` as it must write over the config file while running.\n\n#### Usage\n\nRun the image directly by mounting the config file as a volume:\n\n    $ docker run \\\n      -e SERVICE_HOSTNAME=tasks.galera \\\n      -e UPDATE_FREQUENCY=10 \\\n      -v /path/to/your/haproxy.cfg.tpl:/etc/haproxy.cfg.tpl:ro \\\n      colinmollenhour/haproxy-service:2.6-alpine\n\nOr build the config into the image:\n\n    FROM colinmollenhour/haproxy-service:2.6-alpine\n    COPY haproxy.cfg.tpl /etc/haproxy.cfg.tpl\n    ENV SERVICE_HOSTNAME my-service\n    ENV UPDATE_FREQUENCY 5\n\nSee the `samples/` directory for basic examples.\n\n#### Template Format\n\nAny block of text between the markers `{{HOSTS}}` and `{{/HOSTS}}` (must be on separate lines) will be rendered\nin-place for each IP resolved by the `SERVICE_HOSTNAME`. The variables `$ip` and `$num` (the last octet of the `$ip`)\nwill be replaced accordingly. The IP addresses will always be sorted in the same order.\nThere may be multiple `{{HOSTS}} ... {{/HOSTS}}` blocks in the same template file.\n\nExample:\n\n    default-server inter 1s\n    {{HOSTS}}\n    server node${num} ${ip}:3306 check\n    {{/HOSTS}}\n\nIf the `SERVICE_HOSTNAME` resolves to 10.0.0.12 and 10.0.0.20 it would render:\n\n    default-server inter 1s\n    server node12 10.0.0.12:3306 check\n    server node20 10.0.0.20:3306 check\n\n#### Init Scripts\n\nIf you need to run some basic scripts on init before the first template render mount or add a file at\n`/docker-entrypoint-init.sh` which will be sourced by `docker-entrypoint.sh` once on startup.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinmollenhour%2Fhaproxy-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcolinmollenhour%2Fhaproxy-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcolinmollenhour%2Fhaproxy-service/lists"}