Skip to content

40ants/docker-haproxy

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
etc
 
 
 
 
 
 

Haproxy Docker Image With Correct Logging

This image includes haproxy + rsyslog, correctly supervised by s6.

Usage

Test how it does work:

docker run --rm -ti --name test-haproxy -p 1080:80 40ants/haproxy:1.8.20

Then open in browser http://localhost:1080/

Prepare for production

Replace example haproxy config /etc/haproxy.cfg with your own, and ensure you have these options:

global
    log /dev/log local0

This will tell Haproxy to write log to rsyslog's socket. Rsyslog is configured to redirect all messages to container's stdout.

S6 is supervise both processes and handles system signals, making container to shutdown gracefully when you hit Ctrl-C or docker stop my-proxy.

Used resources

This images is used some ideas from these posts:

About

Docker image for Haproxy with proper logging.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published