Skip to content

Instantly share code, notes, and snippets.

@kevin39
Forked from tebeka/docker-compose.yml
Created February 15, 2019 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kevin39/0c5b25c44d06b62a560a255b8013cd15 to your computer and use it in GitHub Desktop.
Save kevin39/0c5b25c44d06b62a560a255b8013cd15 to your computer and use it in GitHub Desktop.
HAProxy in front of Elasticsearch
elastic:
image: elasticsearch
haproxy:
image: haproxy
volumes:
- ${PWD}:/usr/local/etc/haproxy
links:
- elastic
ports:
- "9200:9200"
# Based on http://j.mp/1YHQFgZ
# vim: ft=haproxy
defaults
timeout connect 5000
timeout client 10000
timeout server 10000
frontend elastic
bind :9200
mode http
acl is_delete method DELETE
http-request deny if is_delete
default_backend elastic
backend elastic
mode http
option forwardfor
balance source
option httpclose
server es1 elastic:9200 weight 1 check inter 1000 rise 5 fall 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment