Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

228
Views
docker-compose scale no funciona con haproxy

Estoy jugando con docker-compose haproxy y nginx. Lo que estoy tratando de lograr es que si escalo el contenedor nginx para que sea

docker-compose escala nginx=2

el contenedor haproxy también actúa como proxy del nuevo contenedor nginx. Pero de alguna manera no reconoce el nuevo contenedor.

Aquí están mis configuraciones:

docker-compose.yml:

 version: '2.1' services: nginx: image: 'bitnami/nginx:latest' healthcheck: test: "curl -f http://localhost/?healthcheck" expose: - "80" haproxy: image: haproxy restart: always depends_on: nginx: condition: service_healthy links: - nginx ports: - "80:80" volumes: - ./haproxy:/usr/local/etc/haproxy/ expose: - "80"

haproxy.cfg

 global log 127.0.0.1 local0 log 127.0.0.1 local1 notice defaults log global mode http option httplog timeout connect 5000 timeout client 10000 timeout server 10000 frontend localnodes bind 0.0.0.0:80 mode http default_backend nodes backend nodes mode http option forwardfor balance roundrobin server nginx nginx:80 check option httpchk GET /?haproxyselfcheck http-check expect status 200

¿Qué podría hacer para que haproxy reconozca el nuevo contenedor sin solo agregar un nginx más en el archivo docker-compose manualmente?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Después de investigar un poco, encontré una solución para trabajar con Docker Swarm. Docker Swarm tiene su propio balanceador de carga. Pero revertir el proxy a los servicios que mejor se ajustan parece ser docker-flow-proxy del legendario Victor Farcic https://github.com/vfarcic/docker-flow-proxy

Luego, uno puede simplemente agregar los nuevos servicios al proxy.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!