Skip to content

tklx/haproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tklx/haproxy - High performance, high availability proxy

CircleCI

HAProxy is free, open source software that provides a high availability load balancer and proxy server for TCP and HTTP-based applications that spreads requests across multiple servers. It is written in C and has a reputation for being fast and efficient (in terms of processor and memory usage).

Features

  • Based on the super slim tklx/base (Debian GNU/Linux).
  • HAProxy installed directly from Debian.
  • Uses tini for zombie reaping and signal forwarding.

Usage

Due to the versatility of HAProxy deployments, we recommend using the official upstream starter guide or configuration and management guides and the provided [examples][haproxy-examples]. This image comes with no custom configuration nor a default set of exposed ports.

While many examples show daemon in the global section of the config file, this will cause the Docker container to fail on launch and should not be enabled.

Running the container with a custom configuration

$ docker run -d --name some-haproxy -v /path/to/haproxy.cfg:/etc/haproxy/haproxy.cfg:ro tklx/haproxy

Checking config file syntax

$ docker run -it --rm --name some-haproxy -v /path/to/haproxy.cfg:/etc/haproxy/haproxy.cfg:ro tklx/haproxy -c -f /etc/haproxy/haproxy.cfg

Exposing the port(s)

User-chosen

$ docker run -d -p 8080:80 -p 4343:443 tklx/haproxy

Randomly chosen by Docker

$ docker run --name some-haproxy -dP tklx/haproxy
$ docker port some-haproxy

Reloading configuration seamlessly

If you have edited your haproxy.cfg file, you can use haproxy's graceful reload feature by sending a SIGHUP to the container:

$ docker kill -s HUP some-haproxy

The entrypoint script in the image replaces the haproxy command with haproxy-systemd-wrapper from HAProxy upstream, which takes care of signal handling to do the graceful reload. Under the hood this uses the -sf option of haproxy so "there are two small windows of a few milliseconds each where it is possible that a few connection failures will be noticed during high loads" (see Stopping and restarting HAProxy).

Automated builds

The Docker image is built, tested and pushed by CircleCI from source hosted on GitHub.

  • Tag: x.y.z refers to a release (recommended).
  • Tag: latest refers to the master branch.

Status

Currently on major version zero (0.y.z). Per Semantic Versioning, major version zero is for initial development, and should not be considered stable. Anything may change at any time.

Issue Tracker

TKLX uses a central issue tracker on GitHub for reporting and tracking of bugs, issues and feature requests.

Releases

No releases published

Packages

No packages published

Languages