-
Notifications
You must be signed in to change notification settings - Fork 9
/
docker-compose.yaml
258 lines (240 loc) · 5.91 KB
/
docker-compose.yaml
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
version: "3.7"
services:
frontend:
image: ghcr.io/spiral/ticket-booking-frontend:latest
ports:
- "3000:3000"
depends_on:
web:
condition: service_healthy
centrifugo-rpc:
image: ghcr.io/spiral/ticket-booking-centrifugo:latest
env_file:
- .env
depends_on:
collector:
condition: service_started
redis:
condition: service_healthy
restart: on-failure
command: >
bash -c "./rr serve"
healthcheck:
test: [ 'CMD-SHELL', 'wget --spider -q "http://127.0.0.1:2114/health?plugin=rpc"' ]
interval: 2s
timeout: 2s
web:
image: ghcr.io/spiral/ticket-booking-web:latest
env_file:
- .env
environment:
DB_DATABASE: homestead
ports:
- "8080:8080"
depends_on:
collector:
condition: service_started
cinema:
condition: service_healthy
payment:
condition: service_healthy
redis:
condition: service_healthy
command: >
bash -c "php app.php migrate
&& ./rr serve"
restart: on-failure
healthcheck:
test: [ 'CMD-SHELL', 'wget --spider -q "http://127.0.0.1:2114/health?plugin=rpc"' ]
interval: 2s
timeout: 2s
users:
image: ghcr.io/spiral/ticket-booking-users:latest
env_file:
- .env
environment:
DB_DATABASE: homestead
ports:
- "2112:2112"
depends_on:
temporal:
condition: service_started
collector:
condition: service_started
redis:
condition: service_healthy
command: >
bash -c "php app.php migrate
&& php app.php db:seed
&& ./rr serve"
restart: on-failure
healthcheck:
test: [ 'CMD-SHELL', 'wget --spider -q "http://127.0.0.1:2114/health?plugin=rpc"' ]
interval: 2s
timeout: 2s
payment:
image: ghcr.io/spiral/ticket-booking-payment:latest
env_file:
- .env
environment:
DB_DATABASE: homestead
depends_on:
temporal:
condition: service_started
collector:
condition: service_started
redis:
condition: service_healthy
command: >
bash -c "php app.php migrate
&& php app.php db:seed
&& ./rr serve"
restart: on-failure
healthcheck:
test: [ 'CMD-SHELL', 'wget --spider -q "http://127.0.0.1:2114/health?plugin=rpc"' ]
interval: 2s
timeout: 2s
cinema:
image: ghcr.io/spiral/ticket-booking-cinema:latest
env_file:
- .env
environment:
DB_DATABASE: homestead
BROADCAST_CONNECTION: centrifugo
depends_on:
temporal:
condition: service_started
collector:
condition: service_started
redis:
condition: service_healthy
command: >
bash -c "php app.php migrate
&& php app.php db:seed
&& ./rr serve"
restart: on-failure
healthcheck:
test: [ 'CMD-SHELL', 'wget --spider -q "http://127.0.0.1:2114/health?plugin=rpc"' ]
interval: 2s
timeout: 2s
db:
container_name: db
image: postgres
environment:
POSTGRES_USER: homestead
POSTGRES_DB: homestead
POSTGRES_PASSWORD: secret
ports:
- "5432:5432"
logging:
driver: none
healthcheck:
test: pg_isready -d $$POSTGRES_DB -U $$POSTGRES_USER
interval: 2s
timeout: 5s
start_period: 2s
postgresql:
container_name: temporal-postgresql
environment:
POSTGRES_PASSWORD: temporal
POSTGRES_USER: temporal
image: postgres
logging:
driver: none
temporal:
container_name: temporal
depends_on:
postgresql:
condition: service_started
environment:
DB: postgresql
DB_PORT: 5432
POSTGRES_USER: temporal
POSTGRES_PWD: temporal
POSTGRES_SEEDS: postgresql
DYNAMIC_CONFIG_FILE_PATH: config/dynamicconfig/development-sql.yaml
image: temporalio/auto-setup
volumes:
- ./docker/temporal:/etc/temporal/config/dynamicconfig
restart: on-failure
logging:
driver: none
temporal-ui:
container_name: temporal-ui
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
image: temporalio/ui:latest
ports:
- "8088:8080"
logging:
driver: none
collector:
image: otel/opentelemetry-collector-contrib
command: [ "--config=/etc/otel-collector-config.yml" ]
volumes:
- ./docker/otel/otel-collector-config.yml:/etc/otel-collector-config.yml
logging:
driver: none
zipkin:
image: openzipkin/zipkin-slim
ports:
- "9411:9411"
logging:
driver: none
redis:
image: redis
logging:
driver: none
healthcheck:
test: [ 'CMD', 'redis-cli', 'ping' ]
interval: 500ms
timeout: 1s
prometheus:
image: prom/prometheus
volumes:
- ./docker/prometheus/:/etc/prometheus/
restart: always
grafana:
image: grafana/grafana
depends_on:
prometheus:
condition: service_started
ports:
- 3001:3000
volumes:
- ./docker/grafana/provisioning/:/etc/grafana/provisioning/
env_file:
- ./docker/grafana/config.monitoring
restart: always
centrifugo:
container_name: centrifugo
image: centrifugo/centrifugo:latest
volumes:
- ./docker/centrifugo/config.json:/centrifugo/config.json
command: centrifugo -c config.json
ports:
- 8089:8000
depends_on:
centrifugo-rpc:
condition: service_healthy
ulimits:
nofile:
soft: 65535
hard: 65535
buggregator:
image: ghcr.io/buggregator/server:latest
ports:
- 8003:8000
birddog:
image: ghcr.io/roadrunner-server/birddog:0.4.0
ports:
- "8002:80"
environment:
DEFAULT_RPC_SERVER: cinema
RPC_SERVER_CINEMA: tcp://cinema:6001
RPC_SERVER_WEB: tcp://web:6001
RPC_SERVER_USERS: tcp://users:6001
RPC_SERVER_PAYMENT: tcp://payment:6001