From 3de513aa91694f808a537e861fe45bcba68aed02 Mon Sep 17 00:00:00 2001 From: Erik Osterman Date: Tue, 22 Dec 2015 02:44:30 -0800 Subject: [PATCH] first commit --- Dockerfile | 7 +++++++ haproxy.cfg | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 57 insertions(+) create mode 100644 Dockerfile create mode 100644 haproxy.cfg diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..204d383 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM ubuntu:14.04 +RUN apt-get update && apt-get -y install haproxy +VOLUME /etc/haproxy +EXPOSE 9000 +EXPOSE 9001 +ADD haproxy.cfg /etc/haproxy/ +CMD haproxy -f /etc/haproxy/haproxy.cfg -db diff --git a/haproxy.cfg b/haproxy.cfg new file mode 100644 index 0000000..8f898c0 --- /dev/null +++ b/haproxy.cfg @@ -0,0 +1,50 @@ +global + #log /dev/log local0 + #log /dev/log local1 notice + chroot /var/lib/haproxy + user haproxy + group haproxy + daemon + +defaults + #log global + mode http + #option httplog + #option dontlognull + contimeout 5000 + clitimeout 50000 + srvtimeout 50000 + + balance roundrobin + option abortonclose + option redispatch + retries 3 + + errorfile 400 /etc/haproxy/errors/400.http + errorfile 403 /etc/haproxy/errors/403.http + errorfile 408 /etc/haproxy/errors/408.http + errorfile 500 /etc/haproxy/errors/500.http + errorfile 502 /etc/haproxy/errors/502.http + errorfile 503 /etc/haproxy/errors/503.http + errorfile 504 /etc/haproxy/errors/504.http + +listen stats 0.0.0.0:9001 # Listen on all IP's on port 9000 + mode http + balance + timeout client 5000 + timeout connect 4000 + timeout server 30000 + + stats enable + # This is the virtual URL to access the stats page + stats uri /haproxy_stats + + # Authentication realm. This can be set to anything. Escape space characters with a backslash. + stats realm HAProxy\ Statistics + + # The user/pass you want to use. Change this password! + stats auth admin:passwordhere + + # This allows you to take down and bring up back end servers. + # This will produce an error on older versions of HAProxy. + stats admin if TRUE