Run two API replicas behind HAProxy with verified failover

This commit is contained in:
Самохвалов Андрей Ремович
2026-10-02 11:53:12 +03:00
parent 44fcce080f
commit 645164cb03
9 changed files with 211 additions and 33 deletions
+26
View File
@@ -0,0 +1,26 @@
global
log stdout format raw local0
defaults
mode http
log global
option httplog
timeout connect 2s
timeout client 15s
timeout server 15s
resolvers docker
nameserver docker 127.0.0.11:53
resolve_retries 2
timeout retry 1s
hold valid 1s
frontend public
bind *:8080
default_backend api
backend api
balance roundrobin
option httpchk GET /health/ready
http-check expect status 200
server-template api 1-4 api:8080 check inter 1s fall 2 rise 1 resolvers docker init-addr none