-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathdocker-compose.yml
111 lines (105 loc) · 2.72 KB
/
docker-compose.yml
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
version: '3.8'
services:
etcd-00:
image: quay.io/coreos/etcd:v3.5.0
hostname: etcd-00
command:
- etcd
- --name=etcd-00
- --data-dir=data.etcd
- --advertise-client-urls=http://etcd-00:2379
- --listen-client-urls=http://0.0.0.0:2379
- --initial-advertise-peer-urls=http://etcd-00:2380
- --listen-peer-urls=http://0.0.0.0:2380
- --initial-cluster=etcd-00=http://etcd-00:2380,etcd-01=http://etcd-01:2380,etcd-02=http://etcd-02:2380
- --initial-cluster-state=new
- --initial-cluster-token=etcd-cluster-1
volumes:
- etcd-00vol:/data.etcd
networks:
- etcd
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
restart: always
etcd-01:
image: quay.io/coreos/etcd:v3.5.0
hostname: etcd-01
command:
- etcd
- --name=etcd-01
- --data-dir=data.etcd
- --advertise-client-urls=http://etcd-01:2379
- --listen-client-urls=http://0.0.0.0:2379
- --initial-advertise-peer-urls=http://etcd-01:2380
- --listen-peer-urls=http://0.0.0.0:2380
- --initial-cluster=etcd-00=http://etcd-00:2380,etcd-01=http://etcd-01:2380,etcd-02=http://etcd-02:2380
- --initial-cluster-state=new
- --initial-cluster-token=etcd-cluster-1
volumes:
- etcd-01vol:/data.etcd
networks:
- etcd
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
restart: always
etcd-02:
image: quay.io/coreos/etcd:v3.5.0
hostname: etcd-02
command:
- etcd
- --name=etcd-02
- --data-dir=data.etcd
- --advertise-client-urls=http://etcd-02:2379
- --listen-client-urls=http://0.0.0.0:2379
- --initial-advertise-peer-urls=http://etcd-02:2380
- --listen-peer-urls=http://0.0.0.0:2380
- --initial-cluster=etcd-00=http://etcd-00:2380,etcd-01=http://etcd-01:2380,etcd-02=http://etcd-02:2380
- --initial-cluster-state=new
- --initial-cluster-token=etcd-cluster-1
volumes:
- etcd-02vol:/data.etcd
networks:
- etcd
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
restart: always
nginx:
image: nginx:alpine
hostname: nginx-etcd
volumes:
- type: bind
source: ./nginx/nginx.conf
target: /etc/nginx/nginx.conf
networks:
- etcd
ports:
- 2379:2379
depends_on:
- etcd-00
- etcd-01
- etcd-02
logging:
driver: "json-file"
options:
max-size: "1m"
max-file: "5"
restart: always
volumes:
etcd-00vol:
driver: local
etcd-01vol:
driver: local
etcd-02vol:
driver: local
networks:
etcd:
driver: bridge