Skip to content

Latest commit

 

History

History
61 lines (43 loc) · 1.56 KB

README.md

File metadata and controls

61 lines (43 loc) · 1.56 KB

haproxy Dockerfile

Docker Hub

This repository contains the Dockerfile and the configuration files of Haproxy for Docker.

Base Docker Image

Installation

docker build -t mkaag/haproxy github.com/mkaag/docker-haproxy

Usage

Basic usage

docker run -d -p 443:443 -p 80:80 -p 1936:1936 mkaag/haproxy

The TCP 1936 is used here for Haproxy stats only.

Using SSL

The PEM file must contains the public, private keys as well as any intermediary certificate.

docker run -d \
-v /opt/haproxy/ssl:/etc/ssl/private \
-e "SSL_CERT=/etc/ssl/private/cert.pem" \
-p 443:443 -p 80:80 -p 1936:1936 \
mkaag/haproxy

Using custom config file

docker run -d \
-v /opt/haproxy/etc:/apps \
-e "HAPROXY_CONFIG=/apps/haproxy.cfg" \
-p 443:443 -p 80:80 -p 1936:1936 \
mkaag/haproxy

Custom config w/ SSL

docker run -d \
-v /opt/haproxy/etc:/apps \
-v /opt/haproxy/ssl:/etc/ssl/private \
-e "HAPROXY_CONFIG=/apps/haproxy.cfg" \
-e "SSL_CERT=/etc/ssl/private/cert.pem" \
-p 443:443 -p 80:80 -p 1936:1936 \
mkaag/haproxy