-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose.yml
186 lines (174 loc) · 4.24 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
version: "3.9"
services:
etcd:
image: quay.io/coreos/etcd
container_name: jinshu-etcd
environment:
ETCDCTL_API: 3
restart: always
command: /usr/local/bin/etcd --name etcd0 --data-dir /etcd-data --listen-client-urls http://0.0.0.0:2379 --advertise-client-urls http://0.0.0.0:2379 --listen-peer-urls http://0.0.0.0:2380 --initial-advertise-peer-urls http://0.0.0.0:2380 --initial-cluster etcd0=http://0.0.0.0:2380 --initial-cluster-token tkn --initial-cluster-state new
stop_signal: SIGTERM
redis:
image: redis
container_name: jinshu-redis
restart: always
sysctls:
net.core.somaxconn: 1024
command: redis-server --requirepass 1qaz2wsx --appendonly yes
stop_signal: SIGTERM
postgres:
image: postgres
container_name: jinshu-postgres
environment:
- POSTGRES_USER=jinshu
- POSTGRES_PASSWORD=1qaz2wsx
- POSTGRES_DB=jinshu
volumes:
- ./script/create_table.sql:/docker-entrypoint-initdb.d/init.sql
stop_signal: SIGTERM
zookeeper:
image: wurstmeister/zookeeper
container_name: jinshu-zookeeper
stop_signal: SIGTERM
kafka:
image: wurstmeister/kafka
container_name: jinshu-kafka
environment:
KAFKA_BROKER_ID: 0
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092
KAFKA_CREATE_TOPICS: "jinshu.dev:2:1"
depends_on:
- zookeeper
stop_signal: SIGTERM
receiver:
build: ./jinshu-receiver
container_name: jinshu-receiver
environment:
JINSHU__ETCD__ENDPOINTS: "etcd:2379"
JINSHU__KAFKA__SERVERS: "kafka:9092"
links:
- etcd
- zookeeper
- kafka
depends_on:
- etcd
- kafka
stop_signal: SIGTERM
authorizer:
build: ./jinshu-authorizer
container_name: jinshu-authorizer
environment:
JINSHU__ETCD__ENDPOINTS: "etcd:2379"
JINSHU__REDIS__HOST: "redis"
links:
- etcd
- redis
depends_on:
- etcd
- redis
stop_signal: SIGTERM
comet:
build: ./jinshu-comet
container_name: jinshu-comet
environment:
JINSHU__ETCD__ENDPOINTS: "etcd:2379"
JINSHU__REDIS__HOST: "redis"
ports:
- "9000:9000"
- "9400:9400"
links:
- etcd
- redis
- authorizer
- receiver
depends_on:
- etcd
- redis
stop_signal: SIGTERM
storage:
build: ./jinshu-storage
container_name: jinshu-storage
environment:
JINSHU__KAFKA__SERVERS: "kafka:9092"
JINSHU__KAFKA__GROUP_ID: "jinshu.storage"
JINSHU__DATABASE__HOST: "postgres"
links:
- zookeeper
- kafka
- postgres
depends_on:
- kafka
- postgres
stop_signal: SIGTERM
pusher:
build: ./jinshu-pusher
container_name: jinshu-pusher
environment:
JINSHU__REDIS__HOST: "redis"
JINSHU__KAFKA__SERVERS: "kafka:9092"
JINSHU__ETCD__ENDPOINTS: "etcd:2379"
JINSHU__KAFKA__GROUP_ID: "jinshu.pusher"
links:
- etcd
- zookeeper
- kafka
- redis
- comet
depends_on:
- etcd
- kafka
- redis
- comet
stop_signal: SIGTERM
gateway:
build: ./jinshu-gateway
container_name: jinshu-gateway
environment:
JINSHU__DATABASE__HOST: "postgres"
JINSHU__REDIS__HOST: "redis"
ports:
- "9200:9200"
links:
- postgres
- redis
depends_on:
- postgres
- redis
stop_signal: SIGTERM
# example
app-server:
build: ./jinshu-gateway/examples
container_name: app-server
environment:
JINSHU__REDIS__HOST: "redis"
JINSHU__DATABASE__HOST: "postgres"
JINSHU__APP__GATEWAY_HOST: "gateway"
ports:
- "8765:8765"
links:
- redis
- postgres
- gateway
depends_on:
- redis
- postgres
- gateway
stop_signal: SIGTERM
app-client:
build: ./jinshu-sdk/examples
container_name: app-client
environment:
JINSHU__APP_CLIENT__SERVER_HOST: "app-server"
JINSHU__CLIENT__COMET_HOST: "comet"
JINSHU__CLIENT__API_URL: "http://api:9500"
links:
- app-server
- comet
#- api
depends_on:
- app-server
- comet
#- api
stop_signal: SIGTERM