Public | Automated Build

Last pushed: 9 days ago
Short Description
A Docker Hub image from haproxy with simple traffic routing, configurable via environment variables
Full Description


A Docker image from haproxy:alpine with simple TCP/HTTP traffic routing, configurable via environment variables


The Docker official image for haproxy does not contain a configuration file. The documentation recommends building a new image containing your haproxy.cfg.

haproxy-env extends haproxy with a simple "patchcord" use case that proxies traffic from a frontend bind port to a backend server:port via tcp or http. It is configured via environment variables and no image build is required.

A typical scenario would be a multi-container application where haproxy-env would tunnel traffic from a frontend node, with publicly exposed IP addresses, to a service running on a backend node.


The following environment variables must be passed into docker run or docker-compose:

  • HAPROXY_MODE - [tcp | http]
  • HAPROXY_BIND_PORT - port_number
  • HAPROXY_BACKEND - address:port
    • address is an ip address or resolvable host name


An example using haproxy-env to tunnel HTTP traffic to a nginx backend can be found on github at bobfraser1/nginx-app.

Docker Pull Command
Source Repository

Comments (0)