{"id":27180525,"url":"https://github.com/acaranta/lbdocker","last_synced_at":"2025-04-09T14:36:33.641Z","repository":{"id":34374248,"uuid":"38299751","full_name":"acaranta/lbdocker","owner":"acaranta","description":"a Dockerized haproxy Load Balancer with inotified conf reload","archived":false,"fork":false,"pushed_at":"2022-12-05T10:15:25.000Z","size":44,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-06-29T23:10:21.793Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"aliyun/aliyun-log-jaeger","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/acaranta.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":"2015-06-30T09:18:55.000Z","updated_at":"2022-02-12T11:41:28.000Z","dependencies_parsed_at":"2023-01-15T06:39:35.042Z","dependency_job_id":null,"html_url":"https://github.com/acaranta/lbdocker","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acaranta%2Flbdocker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acaranta%2Flbdocker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acaranta%2Flbdocker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/acaranta%2Flbdocker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/acaranta","download_url":"https://codeload.github.com/acaranta/lbdocker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248055287,"owners_count":21040151,"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":[],"created_at":"2025-04-09T14:36:32.181Z","updated_at":"2025-04-09T14:36:33.626Z","avatar_url":"https://github.com/acaranta.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LB Docker : HaProxy on inotify\n\nThis project is a Load Balancer for your docker containers using HaProxy.\nIt uses an inotify loop to watch over it's configuration file and reload itself whenever it changes. This container will also check the /hacfg/certs directory for changes (usefull when using certbot like auto updating certificates)\n\n## docker-compose usage :\n```\nservices:\n  lb:\n    image: acaranta/lbdocker:latest\n    environment:\n      - LBID=mydockerlb\n      - LOGSPATH=/lblogs\n      - HASVC=lbdkr.conf\n      - SYSLOG_SERVER=192.168.0.12\n      - SYSLOG_PORT=514\n      - SYSLOG_PROTO=udp\n    ports:\n      - 80:80\n      - 443:443\n    volumes:\n       - /pathtovolumes/lbdkr/conf:/hacfg\n       - /pathtovolumes/lbdkr/log:/lblogs\n    restart: always\n```\n\nEnvironment vars :\n* `LBID` : ID of you load balancer\n* `LOGSPATH` : Path (in the container) where logs will be output\n* `HASVC` : Name your service configuration file which will be located in `/hacfg` within the container\n* `SYSLOG_SERVER` : (Optional) Syslog server address to send logs to\n* `SYSLOG_PORT` : (Optional) Syslog server port\n* `SYSLOG_PROTO` : (Optional) Syslog server protocol (udp/tcp)\n\nNB : `/hacfg` volume is a good place to store your other files such as certificates and such\n\n## Service configuration example :\nService configuration can contain most of the configuration options for an haproxy configuration, except for the `[global]` section.\nFor instance :\n```\n#########################\n#          Auth         #\n#########################\n\nuserlist AuthUsers\n  user useradmin insecure-password S3cureP4ss!\n\n\n#########################\n# Frontends definitions #\n#########################\n\nfrontend front_LB\n\tbind :::80 v4v6\n\tmode http\n\toption httplog\n\toption dontlognull\n\toption forwardfor\n\n       # SSL Redirections\n       redirect scheme https code 301 if { hdr(Host) -i importantweb.example.com } !{ ssl_fc }\n\t   \n       # Insecure sites\n       use_backend back_webassets if { hdr_beg(host) -i assets.example.com }\n\n       #Default\n       default_backend back_default\n\nfrontend front_HTTPS\n\tbind :::443 ssl crt /hacfg/certs/wildcard.example.com.crt ssl crt /hacfg/certs/importantweb.exemple.com.crt accept-proxy v4v6\n\tmode http\n\toption dontlognull\n\toption forwardfor\n\n\tlog-format \"%ci:%cp\\ [%Tl]\\ %ft\\ %b/%s\\ %[ssl_fc_sni]\\ %ST\\ %B\\ %CC\\ %CS\\ %tsc\\ %sq/%bq\\ %hr\\ %hs\\ %{+Q}r\"\n\t\n\tuse_backend back_importantweb  if { ssl_fc_sni importantweb.example.com }\n\t\n    default_backend back_default\n\t\n#######################\n# Backend Definitions #\n#######################\n\nbackend back_default\n        mode http\n        server srv_default mainsrv.mylan.net:80 maxconn 40 check inter 10s fall 4 rise 2 \n\nbackend back_importantweb\n        mode http\n\t\t# Add basic authentication\n        acl AuthUsers_ACL http_auth(AuthUsers)\n        server srv_importantweb secureserver.mylan.net:82 maxconn 40 check inter 10s fall 4 rise 2\n\nbackend back_webassets\n        mode http\n        server srv_webassets mysrvaddress:8080 maxconn 40 check inter 10s fall 4 rise 2\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facaranta%2Flbdocker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Facaranta%2Flbdocker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Facaranta%2Flbdocker/lists"}