mattes / rotating-proxy

Rotating TOR proxy with Docker
The Unlicense
1.13k stars 256 forks source link

Run multiple HAProxy containers on different ports #40

Open dav101 opened 3 years ago

dav101 commented 3 years ago

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)