Created
October 18, 2016 15:57
-
-
Save kerkerj/32333fb07cb34541d9134735d531bcb3 to your computer and use it in GitHub Desktop.
docker HA proxy test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
redis: | |
image: redis | |
ports: | |
- "6379" | |
web1: | |
image: my_image:tag | |
environment: | |
- REDIS_URL=redis:6379 | |
- EXCLUDE_PORTS=7788 | |
links: | |
- redis | |
web2: | |
image: my_image:tag | |
environment: | |
- REDIS_URL=redis:6379 | |
- EXCLUDE_PORTS=7788 | |
links: | |
- redis | |
web3: | |
image: my_image:tag | |
environment: | |
- REDIS_URL=redis:6379 | |
- EXCLUDE_PORTS=7788 | |
links: | |
- redis | |
lb: | |
image: dockercloud/haproxy | |
links: | |
- web1 | |
- web2 | |
- web3 | |
environment: | |
- DOCKER_TLS_VERIFY | |
- DOCKER_HOST | |
- DOCKER_CERT_PATH | |
- STATS_PORT=1936 | |
- STATS_AUTH="auth:auth" | |
volumes: | |
- $DOCKER_CERT_PATH:$DOCKER_CERT_PATH | |
ports: | |
- 5566:80 # 透過 docker_ip:5566 可以連到 web app | |
- 7788:1936 # 透過 docker_ip:7788 可以連到 haproxy 的 stats page |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment