Skip to content

Run multiple HAProxy containers on different ports #40

@dav101

Description

@dav101

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions