-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
83 lines (75 loc) · 1.8 KB
/
Copy pathdocker-compose.yml
File metadata and controls
83 lines (75 loc) · 1.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
version: "3"
# All configuration is isolated to a dedicate network.
networks:
cluster: {}
services:
# Service Registry
consul:
image: gliderlabs/consul-server:latest
command: "-advertise=127.0.0.1 -server -bootstrap"
container_name: consul
hostname: 127.0.0.1
ports:
- 8500:8500
networks:
- cluster
# Registrator:
registrator:
image: gliderlabs/registrator:latest
command: "-internal consul://consul:8500"
container_name: registrator
hostname: 127.0.0.1
depends_on:
- consul
volumes:
- /var/run/docker.sock:/tmp/docker.sock
networks:
- cluster
# Redis master
master:
image: redis:alpine
networks:
- cluster
depends_on:
- registrator
# Redis slave
slave:
image: redis:alpine
command: redis-server --slaveof redis-master 6379
links:
- master:redis-master
networks:
- cluster
depends_on:
- registrator
# Redis Sentinel
sentinel:
build: sentinel
environment:
- SENTINEL_DOWN_AFTER=5000
- SENTINEL_FAILOVER=5000
links:
- master:redis-master
- slave
networks:
- cluster
depends_on:
- registrator
# HaProxy
haproxy:
container_name: haproxy-redis
build: haproxy
environment:
- SERVICE_NAME=haproxy-redis
depends_on:
- master
- slave
- sentinel
- registrator
networks:
- cluster
links:
- consul
ports:
- 9000:9000
- 6379:6379