Skip to content

dpitic/docker-haproxy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

docker-haproxy

Description

Load balancer for 3 web servers. This image was created to deploy a load balancer in a Docker container, to load balance a web server Docker service deployed in a Docker Swarm.

Docker Instructions

Pull the Docker image from Docker Hub:
docker pull xwin/haproxy
Create a container from the image and run it:
docker run -d --name haproxy -p 8080:80 xwin/haproxy

Configure haproxy

Edit the haproxy.cfg file.

Build the container
docker build -t haproxy .
Test the configuration file
docker run -it --rm --name haproxy-syntax-check haproxy -c -f /usr/local/etc/haproxy/haproxy.cfg
Run the container
docker run -d --name haproxy -p 8080:80 haproxy

Test the load balancer

curl localhost:8080

Releases

No releases published

Packages

No packages published