-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
347 lines (332 loc) · 7.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
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
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
version: "3.8"
services:
api-auth:
build:
context: ./
dockerfile: ./api-auth/Dockerfile.dev
env_file:
- ./.env
- ./client/.env
- ./api-auth/.env
- ./postgres/.env
- ./redis/.env
volumes:
- ./api-auth:/hypertube/app
- ./.shared:/hypertube/.shared
depends_on:
- postgres
- redis
restart: unless-stopped
links:
- postgres
- redis
ports:
- "${API_AUTH_GRPC_PORT}:${API_AUTH_GRPC_PORT}"
- "${API_AUTH_GRPC_GATEWAY_PORT}:${API_AUTH_GRPC_GATEWAY_PORT}"
- "${API_AUTH_HTTP_PORT}:${API_AUTH_HTTP_PORT}"
api-user:
build:
context: ./
dockerfile: ./api-user/Dockerfile.dev
env_file:
- ./api-user/.env
- ./postgres/.env
- ./redis/.env
volumes:
- ./api-user:/hypertube/app
- ./.shared:/hypertube/.shared
depends_on:
- postgres
- redis
restart: unless-stopped
links:
- postgres
- redis
ports:
- "${API_USER_GRPC_PORT}:${API_USER_GRPC_PORT}"
- "${API_USER_GRPC_GATEWAY_PORT}:${API_USER_GRPC_GATEWAY_PORT}"
# access to the server:
# $> docker-compose exec server sh
api-picture:
build:
context: ./api-picture
dockerfile: ./Dockerfile.dev
env_file:
- ./.env
- ./postgres/.env
- ./redis/.env
- ./client/.env
- ./api-picture/.env
volumes:
- ./api-picture:/app
- picture-data:/app/storage
- api-picture-node-modules:/app/node_modules
- api-picture-node-yarn:/app/.yarn
depends_on:
- postgres
- redis
restart: unless-stopped
links:
- client
- postgres
- redis
ports:
- "${API_PICTURE_PORT}:${API_PICTURE_PORT}"
api-scrapper:
build:
context: ./
dockerfile: ./api-scrapper/Dockerfile.dev
env_file:
- ./api-scrapper/.env
- ./postgres/.env
volumes:
- ./api-scrapper:/hypertube/app
- ./.shared:/hypertube/.shared
depends_on:
- postgres
restart: unless-stopped
links:
- postgres
ports:
- "${API_SCRAPPER_GRPC_PORT}:${API_SCRAPPER_GRPC_PORT}"
api-media:
build:
context: ./
dockerfile: ./api-media/Dockerfile.dev
env_file:
- ./api-scrapper/.env
- ./api-media/.env
- ./postgres/.env
- ./redis/.env
volumes:
- ./api-media:/hypertube/app
- ./.shared:/hypertube/.shared
depends_on:
- postgres
- api-scrapper
- redis
restart: unless-stopped
links:
- postgres
- api-scrapper
- redis
ports:
- "${API_MEDIA_GRPC_PORT}:${API_MEDIA_GRPC_PORT}"
- "${API_MEDIA_GRPC_GATEWAY_PORT}:${API_MEDIA_GRPC_GATEWAY_PORT}"
api-streaming:
build:
context: ./api-streaming
dockerfile: ./Dockerfile.dev
env_file:
- ./.env
- ./postgres/.env
- ./redis/.env
- ./client/.env
- ./api-streaming/.env
volumes:
- ./api-streaming:/app
- streaming-data:/app/.cache
- api-streaming-node-modules:/app/node_modules
- api-streaming-node-yarn:/app/.yarn
depends_on:
- postgres
restart: unless-stopped
links:
- client
- postgres
ports:
- "${API_STREAMING_PORT}:${API_STREAMING_PORT}"
api-position:
build:
context: ./api-position
dockerfile: ./Dockerfile.dev
env_file:
- ./.env
- ./postgres/.env
- ./redis/.env
- ./client/.env
- ./api-position/.env
volumes:
- ./api-position:/app
- api-position-node-modules:/app/node_modules
- api-position-node-yarn:/app/.yarn
depends_on:
- postgres
- redis
restart: unless-stopped
links:
- client
- postgres
- redis
ports:
- "${API_POSITION_PORT}:${API_POSITION_PORT}"
test-meta:
build: ./test/meta
env_file:
- ./client/.env
- ./api-auth/.env
- ./api-user/.env
- ./api-position/.env
- ./api-media/.env
- ./redis/.env
volumes:
- ./test/meta:/app
- test-meta-node-modules:/app/node_modules
- test-meta-node-yarn:/app/.yarn
depends_on:
- client
- api-auth
- api-user
- api-position
- api-media
- redis
links:
- client
- api-auth
- api-user
- api-position
- api-media
- redis
profiles:
- test
test-go:
build:
dockerfile: ./test/go/Dockerfile
context: ./
env_file:
- ./client/.env
- ./postgres/.env
- ./redis/.env
- ./api-auth/.env
- ./api-user/.env
- ./api-media/.env
- ./api-scrapper/.env
volumes:
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init-base.sql
- ./postgres/init-test.sql:/docker-entrypoint-initdb.d/init-test.sql
- ./test/go:/hypertube/test/go
- ./.shared:/hypertube/.shared
- ./api-auth:/hypertube/api-auth
- ./api-user:/hypertube/api-user
- ./api-media:/hypertube/api-media
- ./api-scrapper:/hypertube/api-scrapper
profiles:
- test
postgres:
image: postgres:14.4-alpine
restart: unless-stopped
env_file:
- ./postgres/.env
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
volumes:
- postgres-data:/var/lib/postgresql/data
- ./postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
# access to the psql CLI:
# $> docker-compose exec postgres psql
redis:
image: redis:7.0.2-alpine
restart: unless-stopped
command: --port ${REDIS_PORT}
env_file:
- ./redis/.env
volumes:
- redis-data:/data
ports:
- "${REDIS_PORT}:${REDIS_PORT}"
# access to the redis CLI:
# $> dc exec -it redis /bin/sh -c 'redis-cli -h redis'
adminer:
image: adminer:4.8.1-standalone
depends_on:
- postgres
ports:
- 5050:8080
restart: unless-stopped
links:
- postgres
tmdb-proxy:
image: nginx:1.23-alpine
env_file:
- ./tmdb-proxy/.env
volumes:
- ./tmdb-proxy/nginx.conf:/etc/nginx/nginx.conf:ro
- nginx-proxy-data:/var/www/cache
ports:
- "${TMDB_PROXY_PORT}:80"
client:
build:
context: ./client
dockerfile: ./Dockerfile.dev
env_file:
- ./.env
- ./api-auth/.env
- ./api-user/.env
- ./api-media/.env
- ./api-streaming/.env
- ./tmdb-proxy/.env
- ./client/.env
volumes:
- ./client:/app
- client-node-modules:/app/node_modules
- client-node-yarn:/app/.yarn
- client-svelte-kit:/app/.svelte-kit
- client-build:/app/build
depends_on:
- api-auth
- api-media
links:
- api-auth
- api-media
- tmdb-proxy
ports:
- "${CLIENT_PORT}:${CLIENT_PORT}"
restart: unless-stopped
streaming-proxy:
image: nginx:1.23-alpine
env_file:
- ./streaming-proxy/.env
volumes:
- ./streaming-proxy/nginx.conf:/etc/nginx/nginx.conf:ro
- streaming-data:/var/www/cache
ports:
- "${STREAMING_PROXY_PORT}:80"
restart: unless-stopped
profiles:
- debug
volumes:
postgres-data:
driver: local
redis-data:
driver: local
nginx-proxy-data:
driver: local
streaming-data:
driver: local
picture-data:
driver: local
# Named modules to avoid unnamed volumes
client-node-modules:
driver: local
client-node-yarn:
driver: local
client-svelte-kit:
driver: local
client-build:
driver: local
test-meta-node-modules:
driver: local
test-meta-node-yarn:
driver: local
api-streaming-node-modules:
driver: local
api-streaming-node-yarn:
driver: local
api-picture-node-modules:
driver: local
api-picture-node-yarn:
driver: local
api-position-node-modules:
driver: local
api-position-node-yarn:
driver: local