Sign inSign up

qber/haproxy

By qber

•Updated almost 11 years ago

Image
0

2.0K

qber/haproxy repository overview

FROM debian:wheezy

RUN apt-get update && apt-get install -y libssl1.0.0 libpcre3 --no-install-recom

ENV HAPROXY_MAJOR 1.6
ENV HAPROXY_VERSION 1.6.2
ENV HAPROXY_MD5 d0ebd3d123191a8136e2e5eb8aaff039
ENV HAPROXY_USER haproxy

⁠see http://sources.debian.net/src/haproxy/1.5.8-1/debian/rules/⁠ for some helpf

RUN buildDeps='curl gcc libc6-dev libpcre3-dev libssl-dev make' \
&& set -x \
&& apt-get update && apt-get install -y $buildDeps --no-install-recommen && curl -SL "http://www.haproxy.org/download/${HAPROXY_MAJOR}/src/haprox⁠ && echo "${HAPROXY_MD5} haproxy.tar.gz" | md5sum -c \
&& mkdir -p /usr/src/haproxy \
&& tar -xzf haproxy.tar.gz -C /usr/src/haproxy --strip-components=1 \
&& rm haproxy.tar.gz \
&& make -C /usr/src/haproxy \
TARGET=linux2628 \
USE_PCRE=1 PCREDIR= \
USE_OPENSSL=1 \
USE_ZLIB=1 \
all \
install-bin \
&& mkdir -p /usr/local/etc/haproxy \
&& cp -R /usr/src/haproxy/examples/errorfiles /usr/local/etc/haproxy/err && rm -rf /usr/src/haproxy \
&& apt-get purge -y --auto-remove $buildDeps

RUN groupadd --system ${HAPROXY_USER} && \
useradd --system --gid ${HAPROXY_USER} ${HAPROXY_USER} && \
mkdir --parents /var/lib/${HAPROXY_USER} && \
chown -R ${HAPROXY_USER}:${HAPROXY_USER} /var/lib/${HAPROXY_USER}

COPY haproxy.cfg /usr/local/etc/haproxy/haproxy.cfg

CMD ["haproxy", "-f", "/usr/local/etc/haproxy/haproxy.cfg"]

======

global #debug chroot /var/lib/haproxy user haproxy group haproxy pidfile /var/run/haproxy.pid

# Default SSL material locations
ca-base /etc/ssl/certs
crt-base /etc/ssl/private

# Default ciphers to use on SSL-enabled listening sockets.
ssl-default-bind-ciphers kEECDH+aRSA+AES:kRSA+AES:+AES256:RC4-SHA:!kEDH:!LOW

spread-checks 4
tune.maxrewrite 1024

defaults mode http balance roundrobin

option  dontlognull
option  dontlog-normal
option  forwardfor
option  redispatch

maxconn 5000
timeout connect 5s
timeout client  20s
timeout server  20s
timeout queue   30s
timeout http-request 5s
timeout http-keep-alive 15s

#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

stats enable
stats refresh 30s
#stats hide-version
stats realm Strictly\ Private
stats auth admin:admin
stats uri /admin?stats

frontend http-in bind *:80 http-request set-header X-Forwarded-Port %[dst_port] default_backend bd_2 acl is_paste path_beg -i /paste acl is_back path_beg -i /back use_backend bd_1 if is_paste use_backend bd_2 if is_back

#frontend https-in

⁠bind *:443

⁠http-request set-header X-Forwarded-Port %[dst_port]

⁠http-request add-header X-Forwarded-Proto https if { ssl_fc }

⁠default_backend bd_2

backend bd_1 #option httpchk HEAD / HTTP/1.1\r\nHost:localhost reqrep ^([^\ :])\ /paste/(.) \1\ /\2 server web1 192.168.1.11:8082 check cookie s1 backend bd_2 reqrep ^([^\ :])\ /back/(.) \1\ /\2 server web2 192.168.1.11:8081 check cookie s2

======

sudo docker run -t -i -p 80:80 -p 8080:8080 -p 443:443 --nam e happ -v /usr/local/etc/haproxy/:/usr/local/etc/haproxy/ qber/haproxy:latest

Tag summary

Content type

Image

Digest

Size

41.1 MB

Last updated

almost 11 years ago

docker pull qber/haproxy