Add haproxy alpine container

This commit is contained in:
AJ NOURI 2016-04-08 12:39:11 +02:00
parent 19ab311e02
commit 6382383df2
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,7 @@
FROM alpine
RUN apk update
RUN apk add haproxy
RUN mkdir /etc/haproxy
ADD haproxy.cfg /etc/haproxy/haproxy.cfg
VOLUME /etc/haproxy/
CMD /usr/sbin/haproxy -fdV /etc/haproxy/haproxy.cfg

View File

@ -0,0 +1,46 @@
#---------------------------------------------------------------------
# Global settings
#---------------------------------------------------------------------
global
pidfile /var/run/haproxy.pid
maxconn 4000
user haproxy
group haproxy
#daemon
debug
#---------------------------------------------------------------------
# common defaults that all the 'listen' and 'backend' sections will
# use if not designated in their block
#---------------------------------------------------------------------
defaults
mode http
option http-server-close
option forwardfor except 127.0.0.0/8
option redispatch
retries 3
timeout http-request 10s
timeout queue 1m
timeout connect 10s
timeout client 1m
timeout server 1m
timeout http-keep-alive 10s
timeout check 10s
maxconn 3000
#---------------------------------------------------------------------
# main frontend which proxys to the backends
#---------------------------------------------------------------------
frontend main
bind *:80
default_backend app
#---------------------------------------------------------------------
# round robin balancing between the various backends
#---------------------------------------------------------------------
backend app
balance roundrobin
server app1 192.168.41.1:80 check
server app2 192.168.41.2:80 check
server app3 192.168.41.3:80 check