-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
408 lines (390 loc) · 12 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
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
volumes:
auth-hooks-node-modules:
background-worker-node-modules:
es-data:
faktory-data:
gateway-node-modules:
import-worker-node-modules:
pg-data:
transcode-worker-node-modules:
transcribe-worker-node-modules:
web-go-node-modules:
web-node-modules:
web-next-node-modules:
web-next-dot-output:
web-next-dot-vinxi:
web-astro-node-modules:
x-s3-env: &s3-env
S3_INGEST_REGION: ${S3_INGEST_REGION}
S3_INGEST_ENDPOINT: ${S3_INGEST_ENDPOINT}
S3_INGEST_BUCKET: ${S3_INGEST_BUCKET}
S3_INGEST_ACCESS_KEY_ID: ${S3_INGEST_ACCESS_KEY_ID}
S3_INGEST_SECRET_ACCESS_KEY: ${S3_INGEST_SECRET_ACCESS_KEY}
S3_PUBLIC_REGION: ${S3_PUBLIC_REGION}
S3_PUBLIC_ENDPOINT: ${S3_PUBLIC_ENDPOINT}
S3_PUBLIC_BUCKET: ${S3_PUBLIC_BUCKET}
S3_PUBLIC_ACCESS_KEY_ID: ${S3_PUBLIC_ACCESS_KEY_ID}
S3_PUBLIC_SECRET_ACCESS_KEY: ${S3_PUBLIC_SECRET_ACCESS_KEY}
services:
#
# App Services
#
web:
build:
context: ./apps/web
dockerfile: Dockerfile
command: npm run dev
restart: unless-stopped
ports:
- 127.0.0.1:${HOST_WEB_PORT}:3000
environment:
NODE_ENV: development
GRAPHQL_URL: http://gateway:3000/graphql
volumes:
- ./apps/web:/home/node/app
- web-node-modules:/home/node/app/node_modules
depends_on:
- gateway
web-next:
build:
context: ./apps/web-next
dockerfile: Dockerfile
command: npm run dev
restart: unless-stopped
ports:
- 127.0.0.1:${HOST_WEB_NEXT_PORT}:3000
- 127.0.0.1:${HOST_WEB_HMR_PORT}:${INTERNAL_WEB_HMR_PORT}
environment:
NODE_ENV: development
COOKIE_SECRET: ${WEB_COOKIE_SECRET}
GRAPHQL_URL: http://gateway:3000/graphql
INTERNAL_WEB_HMR_PORT: ${INTERNAL_WEB_HMR_PORT}
VITE_MAPBOX_MAP_TOKEN: ${MAPBOX_MAP_TOKEN}
VITE_MAPBOX_SEARCHBOX_TOKEN: ${MAPBOX_SEARCHBOX_TOKEN}
volumes:
- ./apps/web-next:/home/node/app
- web-next-node-modules:/home/node/app/node_modules
- web-next-dot-vinxi:/home/node/app/.vinxi
- web-next-dot-output:/home/node/app/.output
depends_on:
- gateway
web-go:
build:
context: ./services/web
dockerfile: Dockerfile
target: build
command: ./dev.sh
restart: unless-stopped
ports:
- 127.0.0.1:${HOST_WEB_GO_PORT}:3000
environment:
APP_ENV: development
COOKIE_SECRET: ${WEB_COOKIE_SECRET}
DATABASE_URL: postgres://letschurch:password@postgres:5432/letschurch
FAKTORY_URL: tcp://faktory:7419
JWT_SECRET: ${JWT_SECRET}
LISTMONK_INTERNAL_URL: http://listmonk:9000
MEDIA_URL: ${MEDIA_URL}
PUBLIC_URL: ${HOST_WEB_GO_URL}
ZXCVBN_MINIMUM_SCORE: ${ZXCVBN_MINIMUM_SCORE}
<<: *s3-env
volumes:
- ./services/web:/usr/src/app
- web-go-node-modules:/usr/src/app/node_modules
depends_on:
- postgres
- elasticsearch
# web-astro:
# build:
# context: ./apps/web-astro
# dockerfile: Dockerfile
# command: npm run dev
# restart: unless-stopped
# ports:
# - 127.0.0.1:${HOST_WEB_NEXT_PORT}:4321
# environment:
# NODE_ENV: development
# COOKIE_SECRET: ${WEB_COOKIE_SECRET}
# GRAPHQL_URL: http://gateway:3000/graphql
# PUBLIC_MAPBOX_MAP_TOKEN: ${MAPBOX_MAP_TOKEN}
# PUBLIC_MAPBOX_SEARCHBOX_TOKEN: ${MAPBOX_SEARCHBOX_TOKEN}
# TURNSTILE_SECRET_KEY: "1x0000000000000000000000000000000AA"
# volumes:
# - ./apps/web-astro:/home/node/app
# - web-astro-node-modules:/home/node/app/node_modules
# depends_on:
# - gateway
gateway:
build:
context: ./services/gateway
target: server
command: npm run dev:server
restart: unless-stopped
ports:
- 127.0.0.1:${HOST_GATEWAY_PORT}:3000
environment:
NODE_ENV: development
SENTRY_DSN: ${SENTRY_GATEWAY_DSN}
SERVICE_NAME: gateway
DATABASE_URL: postgres://letschurch:password@postgres:5432/letschurch
ELASTICSEARCH_URL: http://elasticsearch:9200
IMGPROXY_KEY: ${IMGPROXY_KEY}
IMGPROXY_SALT: ${IMGPROXY_SALT}
IMGPROXY_URL: ${IMGPROXY_URL}
JWT_SECRET: ${JWT_SECRET}
LISTMONK_INTERNAL_URL: http://listmonk:9000
MAPBOX_GEOCODING_TOKEN: ${MAPBOX_GEOCODING_TOKEN}
MEDIA_URL: ${MEDIA_URL}
TEMPORAL_ADDRESS: temporal:7233
WEB_URL: ${WEB_URL}
ZXCVBN_MINIMUM_SCORE: ${ZXCVBN_MINIMUM_SCORE}
<<: *s3-env
volumes:
- ./services/gateway:/home/node/app
- gateway-node-modules:/home/node/app/node_modules
depends_on:
- temporal
background-worker:
build:
context: ./services/gateway
target: background-worker
command: npm run dev:background-worker
restart: unless-stopped
environment:
NODE_ENV: development
SENTRY_DSN: ${SENTRY_BACKGROUND_WORKER_DSN}
SERVICE_NAME: background-worker
IDENTITY: dev
DATABASE_URL: postgres://letschurch:password@postgres:5432/letschurch
ELASTICSEARCH_URL: http://elasticsearch:9200
MAPBOX_GEOCODING_TOKEN: ${MAPBOX_GEOCODING_TOKEN}
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_SHUTDOWN_GRACE_TIME: 1m
<<: *s3-env
SMTP_URL: smtp://mailpit:1025?pool=true
volumes:
- ./services/gateway:/home/node/app
- background-worker-node-modules:/home/node/app/node_modules
background-worker-go:
build:
context: ./services/web
dockerfile: Dockerfile
target: build
command: watchexec --restart --exts go -- go run cmd/background-worker/main.go
restart: unless-stopped
environment:
APP_ENV: development
FAKTORY_URL: tcp://faktory:7419
SERVICE_NAME: background-worker
SMTP_URL: smtp://mailpit:1025
volumes:
- ./services/web:/usr/src/app
probe-worker:
build:
context: ./services/gateway
target: probe-worker
command: npm run dev:probe-worker
restart: unless-stopped
environment:
NODE_ENV: development
SENTRY_DSN: ${SENTRY_TRANSCODE_WORKER_DSN}
SERVICE_NAME: transcode-worker
IDENTITY: dev
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_SHUTDOWN_GRACE_TIME: 1h
MAX_CONCURRENT_ACTIVITY_TASK_EXECUTIONS: 5
<<: *s3-env
volumes:
- ./services/gateway:/home/node/app
- transcode-worker-node-modules:/home/node/app/node_modules
transcode-worker:
build:
context: ./services/gateway
target: transcode-worker
command: npm run dev:transcode-worker
restart: unless-stopped
environment:
NODE_ENV: development
SENTRY_DSN: ${SENTRY_TRANSCODE_WORKER_DSN}
SERVICE_NAME: transcode-worker
IDENTITY: dev
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_SHUTDOWN_GRACE_TIME: 1h
MAX_CONCURRENT_ACTIVITY_TASK_EXECUTIONS: 1
<<: *s3-env
volumes:
- ./services/gateway:/home/node/app
- transcode-worker-node-modules:/home/node/app/node_modules
transcribe-worker:
build:
context: ./services/gateway
target: transcribe-worker
command: npm run dev:transcribe-worker
restart: unless-stopped
environment:
NODE_ENV: development
SENTRY_DSN: ${SENTRY_TRANSCRIBE_WORKER_DSN}
SERVICE_NAME: transcribe-worker
IDENTITY: dev
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_SHUTDOWN_GRACE_TIME: 1h
MAX_CONCURRENT_ACTIVITY_TASK_EXECUTIONS: 1
WHISPER_MODEL: tiny.en
<<: *s3-env
volumes:
- ./services/gateway:/home/node/app
- transcribe-worker-node-modules:/home/node/app/node_modules
import-worker:
build:
context: ./services/gateway
target: import-worker
command: npm run dev:import-worker
restart: unless-stopped
environment:
NODE_ENV: development
SENTRY_DSN: ${SENTRY_IMPORT_WORKER_DSN}
SERVICE_NAME: import-worker
IDENTITY: dev
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_SHUTDOWN_GRACE_TIME: 1m
<<: *s3-env
volumes:
- ./services/gateway:/home/node/app
- import-worker-node-modules:/home/node/app/node_modules
#
# Vendor Services
#
listmonk:
image: listmonk/listmonk:v3.0.0
command:
[
sh,
-c,
"yes | ./listmonk --install --config config-demo.toml && ./listmonk --config config-demo.toml",
]
environment:
LISTMONK_db__host: postgres
TZ: US/Eastern
ports:
- "127.0.0.1:${HOST_LISTMONK_PORT}:9000"
depends_on:
- postgres
imgproxy:
image: darthsim/imgproxy:v3.21.0
environment:
IMGPROXY_KEY: ${IMGPROXY_KEY}
IMGPROXY_SALT: ${IMGPROXY_SALT}
IMGPROXY_USE_S3: true
IMGPROXY_S3_REGION: ${S3_INGEST_REGION}
IMGPROXY_S3_ENDPOINT: ${S3_INGEST_ENDPOINT}
AWS_ACCESS_KEY_ID: ${S3_INGEST_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${S3_INGEST_SECRET_ACCESS_KEY}
ports:
- 127.0.0.1:${HOST_IMGPROXY_PORT}:8080
faktory:
image: contribsys/faktory:1.9.0
ports:
- 127.0.0.1:${HOST_FAKTORY_PORT}:7419
- 127.0.0.1:${HOST_FAKTORY_UI_PORT}:7420
volumes:
- faktory-data:/var/lib/faktory/db
temporal:
image: temporalio/auto-setup:1.22.4.0
environment:
# See auto-setup.sh: https://github.com/temporalio/docker-builds/blob/a442b94edbe10bb49e2f0fc00c3154cdf0590be5/docker/auto-setup.sh
SKIP_DB_CREATE: true # Database is already created via init script
DB: postgresql # Database vendor
DB_PORT: 5432 # Database port
POSTGRES_SEEDS: postgres # Databae server
POSTGRES_USER: temporal # Database user
POSTGRES_PWD: password # Database user password
DBNAME: temporal # Database on server
VISIBILITY_DBNAME: temporal_visibility
DYNAMIC_CONFIG_FILE_PATH: config/dynamicconfig/development-sql.yml
ENABLE_ES: true
ES_SEEDS: elasticsearch
ES_VERSION: v7 # Even though we run v8, temporal only has configuration for v7
ports:
- 127.0.0.1:${HOST_TEMPORAL_PORT}:7233
volumes:
- ./etc/temporal/dynamicconfig:/etc/temporal/config/dynamicconfig
depends_on:
- postgres
- elasticsearch
temporal-admin-tools:
image: temporalio/admin-tools:1.22.4.0
environment:
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_CLI_ADDRESS: temporal:7233
stdin_open: true
tty: true
depends_on:
- temporal
temporal-ui:
image: temporalio/ui:2.22.2
environment:
TEMPORAL_ADDRESS: temporal:7233
TEMPORAL_CORS_ORIGINS: http://localhost:3000
ports:
- 127.0.0.1:${HOST_TEMPORAL_UI_PORT}:8080
depends_on:
- temporal
#
# Service Dependencies
#
postgres:
image: postgres:14.7-alpine
environment:
POSTGRES_USER: ${PG_USER}
POSTGRES_PASSWORD: ${PG_PASSWORD}
POSTGRES_DB: ${PG_DATABASE}
ports:
- 127.0.0.1:${HOST_PG_PORT}:5432
volumes:
- ./etc/postgres-init:/docker-entrypoint-initdb.d
- pg-data:/var/lib/postgresql/data
command:
[
"postgres",
"-c",
"log_statement=all",
"-c",
"log_min_duration_statement=0",
]
elasticsearch:
image: elasticsearch:8.5.2
environment:
- cluster.routing.allocation.disk.threshold_enabled=true
- cluster.routing.allocation.disk.watermark.low=512mb
- cluster.routing.allocation.disk.watermark.high=256mb
- cluster.routing.allocation.disk.watermark.flood_stage=128mb
- discovery.type=single-node
- ES_JAVA_OPTS=-Xms256m -Xmx256m
- xpack.security.enabled=false
ports:
- 127.0.0.1:${HOST_ES_PORT}:9200
volumes:
- es-data:/usr/share/elasticsearch/data
#
# Development
#
kibana:
image: kibana:8.12.0
environment:
ELASTICSEARCH_HOSTS: http://elasticsearch:9200
depends_on:
- elasticsearch
ports:
- 127.0.0.1:${HOST_KIBANA_PORT}:5601
mailpit:
image: axllent/mailpit:v1.13.0
restart: always
ports:
- 127.0.0.1:${HOST_MAILPIT_SMTP_PORT}:1025 # smtp server
- 127.0.0.1:${HOST_MAILPIT_WEB_PORT}:8025 # web ui
pgweb:
image: sosedoff/pgweb:0.14.2
environment:
PGWEB_DATABASE_URL: postgres://letschurch:password@postgres:5432/letschurch?sslmode=disable
ports:
- 127.0.0.1:${HOST_PGWEB_PORT}:8081