rotating-proxy icon indicating copy to clipboard operation
rotating-proxy copied to clipboard

Run multiple HAProxy containers on different ports

Open dav101 opened this issue 5 years ago • 0 comments

I have 2 docker containers running using docker run -d -p 5566:5566 -p 4444:4444 --env tors=25 mattes/rotating-proxy docker run -d -p 5567:5566 -p 4445:4444 --env tors=25 mattes/rotating-proxy

One on port 5566 and one on 5567 but they do not run concurrently, either one runs or the other. I looked into the container with command docker exec -it <containerID> /bin/bash and found there are 3 haproxy configurations

  1. /etc/haproxy/haproxy.cfg – doesn’t define frontend or backend definitions
  2. /usr/local/etc/haproxy.cfg.erb – defines frontend and but does not specify binding port
  3. /usr/local/etc/haproxy.cfg – defines frontend binding port 5566 I want to be able to define the ports to run on inside the docker container and I believe I should set the binding port in file /usr/local/etc/haproxy.cfg is this correct?

I also want to be able to stop start haproxy service, I believe there is a executable to run this /etc/init.d/haproxy How do I stop start the haproxy service?

Spec: Server: Ubuntu 18.04 (running as VM)

dav101 avatar Nov 11 '20 19:11 dav101