1
0
Fork 0
docker-easy-haproxy/examples/docker/docker-compose-multi-containers.yml
2022-08-15 19:39:25 +00:00

37 lines
867 B
YAML

# curl -H Host:www.helloworld.com localhost:19901
# f6d8d45b7411
# 59b213cb8592
# curl -I -H Host:google.helloworld.com localhost:19901
# HTTP/1.1 301 Moved Permanently
# content-length: 0
# location: www.google.com/
version: "3"
services:
haproxy:
image: byjg/easy-haproxy
volumes:
- /var/run/docker.sock:/var/run/docker.sock
environment:
EASYHAPROXY_DISCOVER: docker
HAPROXY_CUSTOMERRORS: "true"
HAPROXY_USERNAME: admin
HAPROXY_PASSWORD: password
HAPROXY_STATS_PORT: 1936
ports:
- 19901:19901
nginx:
#image: nginx
image: stenote/nginx-hostname
deploy:
replicas: 2
labels:
easyhaproxy.http.redirect: '{"google.helloworld.com": "www.google.com"}'
easyhaproxy.http.host: www.helloworld.com
easyhaproxy.http.port: 19901
easyhaproxy.http.localport: 80