-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
731 lines (730 loc) · 22.6 KB
/
Copy pathdocker-compose.yml
File metadata and controls
731 lines (730 loc) · 22.6 KB
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
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
name: timeamber
networks:
default:
name: timeamber_default
services:
auth:
container_name: supabase-auth
depends_on:
db:
condition: service_healthy
required: true
environment:
API_EXTERNAL_URL: ${API_EXTERNAL_URL}
GOTRUE_API_HOST: 0.0.0.0
GOTRUE_API_PORT: 9999
GOTRUE_DB_DATABASE_URL: postgres://supabase_auth_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
GOTRUE_DB_DRIVER: postgres
GOTRUE_DISABLE_SIGNUP: ${DISABLE_SIGNUP}
GOTRUE_EXTERNAL_ANONYMOUS_USERS_ENABLED: ${ENABLE_ANONYMOUS_USERS}
GOTRUE_EXTERNAL_EMAIL_ENABLED: ${ENABLE_EMAIL_SIGNUP}
GOTRUE_EXTERNAL_PHONE_ENABLED: ${ENABLE_PHONE_SIGNUP}
GOTRUE_JWT_ADMIN_ROLES: service_role
GOTRUE_JWT_AUD: authenticated
GOTRUE_JWT_DEFAULT_GROUP_NAME: authenticated
GOTRUE_JWT_EXP: ${JWT_EXPIRY}
GOTRUE_JWT_ISSUER: ${API_EXTERNAL_URL}/auth/v1
GOTRUE_JWT_SECRET: ${JWT_SECRET}
GOTRUE_MAILER_AUTOCONFIRM: ${ENABLE_EMAIL_AUTOCONFIRM}
GOTRUE_MAILER_URLPATHS_CONFIRMATION: ${MAILER_URLPATHS_CONFIRMATION}
GOTRUE_MAILER_URLPATHS_EMAIL_CHANGE: ${MAILER_URLPATHS_EMAIL_CHANGE}
GOTRUE_MAILER_URLPATHS_INVITE: ${MAILER_URLPATHS_INVITE}
GOTRUE_MAILER_URLPATHS_RECOVERY: ${MAILER_URLPATHS_RECOVERY}
GOTRUE_SITE_URL: ${SITE_URL}
GOTRUE_SMS_AUTOCONFIRM: ${ENABLE_PHONE_AUTOCONFIRM}
GOTRUE_SMTP_ADMIN_EMAIL: ${SMTP_ADMIN_EMAIL}
GOTRUE_SMTP_HOST: ${SMTP_HOST}
GOTRUE_SMTP_PASS: ${SMTP_PASS}
GOTRUE_SMTP_PORT: ${SMTP_PORT}
GOTRUE_SMTP_SENDER_NAME: ${SMTP_SENDER_NAME}
GOTRUE_SMTP_USER: ${SMTP_USER}
GOTRUE_URI_ALLOW_LIST: ${ADDITIONAL_REDIRECT_URLS}
healthcheck:
interval: 5s
retries: 3
test:
- CMD
- wget
- --no-verbose
- --tries=1
- --spider
- http://localhost:9999/health
timeout: 5s
image: supabase/gotrue:v2.189.0
networks:
default: null
restart: unless-stopped
db:
command:
- postgres
- -c
- config_file=/etc/postgresql/postgresql.conf
- -c
- log_min_messages=fatal
container_name: supabase-db
environment:
JWT_EXP: ${JWT_EXPIRY}
JWT_SECRET: ${JWT_SECRET}
PGDATABASE: ${POSTGRES_DB}
PGPASSWORD: ${POSTGRES_PASSWORD}
PGPORT: ${POSTGRES_PORT}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_HOST: /var/run/postgresql
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PORT: ${POSTGRES_PORT}
healthcheck:
interval: 5s
retries: 10
test:
- CMD
- pg_isready
- -U
- postgres
- -h
- localhost
timeout: 5s
image: supabase/postgres:15.8.1.085
networks:
default: null
restart: unless-stopped
volumes:
- bind:
create_host_path: true
selinux: Z
source: /volume1/docker/timeamber/deploy/supabase/volumes/db/realtime.sql
target: /docker-entrypoint-initdb.d/migrations/99-realtime.sql
type: bind
- bind:
create_host_path: true
selinux: Z
source: /volume1/docker/timeamber/deploy/supabase/volumes/db/webhooks.sql
target: /docker-entrypoint-initdb.d/init-scripts/98-webhooks.sql
type: bind
- bind:
create_host_path: true
selinux: Z
source: /volume1/docker/timeamber/deploy/supabase/volumes/db/roles.sql
target: /docker-entrypoint-initdb.d/init-scripts/99-roles.sql
type: bind
- bind:
create_host_path: true
selinux: Z
source: /volume1/docker/timeamber/deploy/supabase/volumes/db/jwt.sql
target: /docker-entrypoint-initdb.d/init-scripts/99-jwt.sql
type: bind
- bind:
create_host_path: true
selinux: Z
source: /volume1/docker/timeamber/deploy/supabase/volumes/db/data
target: /var/lib/postgresql/data
type: bind
- bind:
create_host_path: true
selinux: Z
source: /volume1/docker/timeamber/deploy/supabase/volumes/db/_supabase.sql
target: /docker-entrypoint-initdb.d/migrations/97-_supabase.sql
type: bind
- bind:
create_host_path: true
selinux: Z
source: /volume1/docker/timeamber/deploy/supabase/volumes/db/logs.sql
target: /docker-entrypoint-initdb.d/migrations/99-logs.sql
type: bind
- bind:
create_host_path: true
selinux: Z
source: /volume1/docker/timeamber/deploy/supabase/volumes/db/pooler.sql
target: /docker-entrypoint-initdb.d/migrations/99-pooler.sql
type: bind
- source: db-config
target: /etc/postgresql-custom
type: volume
volume: {}
functions:
command:
- start
- --main-service
- /home/deno/functions/main
container_name: supabase-edge-functions
depends_on:
kong:
condition: service_healthy
required: true
environment:
JWT_SECRET: ${JWT_SECRET}
SUPABASE_ANON_KEY: ${ANON_KEY}
SUPABASE_DB_URL: postgresql://postgres:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
SUPABASE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
SUPABASE_PUBLISHABLE_KEYS: '{"default":"${SUPABASE_PUBLISHABLE_KEY:-}"}'
SUPABASE_SECRET_KEYS: '{"default":"${SUPABASE_SECRET_KEY:-}"}'
SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
SUPABASE_URL: http://kong:8000
VERIFY_JWT: ${FUNCTIONS_VERIFY_JWT}
healthcheck:
interval: 5s
retries: 3
test:
- CMD-SHELL
- timeout 1 bash -c '</dev/tcp/127.0.0.1/9000'
timeout: 5s
image: supabase/edge-runtime:v1.74.0
networks:
default: null
restart: unless-stopped
volumes:
- bind:
create_host_path: true
selinux: z
source: /volume1/docker/timeamber/deploy/supabase/volumes/functions
target: /home/deno/functions
type: bind
- source: deno-cache
target: /root/.cache/deno
type: volume
volume: {}
imgproxy:
container_name: supabase-imgproxy
environment:
IMGPROXY_AUTO_WEBP: ${IMGPROXY_AUTO_WEBP}
IMGPROXY_BIND: :5001
IMGPROXY_LOCAL_FILESYSTEM_ROOT: /
IMGPROXY_MAX_SRC_RESOLUTION: 16.8
IMGPROXY_USE_ETAG: "true"
healthcheck:
interval: 5s
retries: 3
test:
- CMD
- imgproxy
- health
timeout: 5s
image: darthsim/imgproxy:v3.30.1
networks:
default: null
restart: unless-stopped
volumes:
- bind:
create_host_path: true
selinux: z
source: /volume1/docker/timeamber/deploy/supabase/volumes/storage
target: /var/lib/storage
type: bind
kong:
container_name: supabase-kong
entrypoint:
- /bin/sh
- /home/kong/kong-entrypoint.sh
environment:
ANON_KEY_ASYMMETRIC: ${ANON_KEY_ASYMMETRIC:-}
DASHBOARD_PASSWORD: ${DASHBOARD_PASSWORD}
DASHBOARD_USERNAME: ${DASHBOARD_USERNAME}
KONG_DATABASE: 'off'
KONG_DECLARATIVE_CONFIG: /usr/local/kong/kong.yml
KONG_DNS_NOT_FOUND_TTL: 1
KONG_DNS_ORDER: LAST,A,CNAME
KONG_NGINX_HTTP_CLIENT_MAX_BODY_SIZE: 0
KONG_NGINX_PROXY_PROXY_BUFFER_SIZE: 160k
KONG_NGINX_PROXY_PROXY_BUFFERS: 64 160k
KONG_PLUGINS: request-transformer,cors,key-auth,acl,basic-auth,request-termination,ip-restriction,post-function
KONG_PROXY_ACCESS_LOG: /dev/stdout combined
SERVICE_ROLE_KEY_ASYMMETRIC: ${SERVICE_ROLE_KEY_ASYMMETRIC:-}
SUPABASE_ANON_KEY: ${ANON_KEY}
SUPABASE_PUBLISHABLE_KEY: ${SUPABASE_PUBLISHABLE_KEY:-}
SUPABASE_SECRET_KEY: ${SUPABASE_SECRET_KEY:-}
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
healthcheck:
interval: 5s
retries: 5
test:
- CMD
- kong
- health
timeout: 5s
image: kong/kong:3.9.1
networks:
default:
aliases:
- api-gw
ports:
- ${TAILSCALE_IP:-127.0.0.1}:${KONG_HTTP_PORT}:8000/tcp
- ${TAILSCALE_IP:-127.0.0.1}:${KONG_HTTPS_PORT}:8443/tcp
restart: unless-stopped
volumes:
- bind:
create_host_path: true
selinux: z
read_only: true
source: /volume1/docker/timeamber/deploy/supabase/volumes/api/kong.yml
target: /home/kong/temp.yml
type: bind
- bind:
create_host_path: true
selinux: z
read_only: true
source: /volume1/docker/timeamber/deploy/supabase/volumes/api/kong-entrypoint.sh
target: /home/kong/kong-entrypoint.sh
type: bind
meta:
container_name: supabase-meta
depends_on:
db:
condition: service_healthy
required: true
environment:
CRYPTO_KEY: ${PG_META_CRYPTO_KEY}
PG_META_DB_HOST: ${POSTGRES_HOST}
PG_META_DB_NAME: ${POSTGRES_DB}
PG_META_DB_PASSWORD: ${POSTGRES_PASSWORD}
PG_META_DB_PORT: ${POSTGRES_PORT}
PG_META_DB_USER: supabase_admin
PG_META_PORT: 8080
image: supabase/postgres-meta:v0.96.6
networks:
default: null
profiles:
- admin
restart: unless-stopped
realtime:
container_name: realtime-dev.supabase-realtime
depends_on:
db:
condition: service_healthy
required: true
environment:
API_JWT_SECRET: ${JWT_SECRET}
APP_NAME: realtime
DB_AFTER_CONNECT_QUERY: SET search_path TO _realtime
DB_ENC_KEY: supabaserealtime
DB_HOST: ${POSTGRES_HOST}
DB_NAME: ${POSTGRES_DB}
DB_PASSWORD: ${POSTGRES_PASSWORD}
DB_PORT: ${POSTGRES_PORT}
DB_USER: supabase_admin
DISABLE_HEALTHCHECK_LOGGING: "true"
DNS_NODES: ''''''
ERL_AFLAGS: -proto_dist inet_tcp
METRICS_JWT_SECRET: ${JWT_SECRET}
PORT: 4000
RLIMIT_NOFILE: "10000"
RUN_JANITOR: "true"
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
SEED_SELF_HOST: "true"
healthcheck:
interval: 30s
retries: 3
start_period: 10s
test:
- CMD-SHELL
- 'curl -sSfL --head -o /dev/null -H "Authorization: Bearer ${ANON_KEY}" http://localhost:4000/api/tenants/realtime-dev/health'
timeout: 5s
image: supabase/realtime:v2.102.3
networks:
default: null
restart: unless-stopped
rest:
command:
- postgrest
container_name: supabase-rest
depends_on:
db:
condition: service_healthy
required: true
environment:
PGRST_APP_SETTINGS_JWT_EXP: ${JWT_EXPIRY}
PGRST_APP_SETTINGS_JWT_SECRET: ${JWT_SECRET}
PGRST_DB_ANON_ROLE: anon
PGRST_DB_EXTRA_SEARCH_PATH: ${PGRST_DB_EXTRA_SEARCH_PATH:-public}
PGRST_DB_MAX_ROWS: ${PGRST_DB_MAX_ROWS:-1000}
PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS}
PGRST_DB_URI: postgres://authenticator:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
PGRST_DB_USE_LEGACY_GUCS: "false"
PGRST_JWT_SECRET: ${JWT_JWKS:-${JWT_SECRET}}
image: postgrest/postgrest:v14.12
networks:
default: null
restart: unless-stopped
storage:
container_name: supabase-storage
depends_on:
db:
condition: service_healthy
required: true
imgproxy:
condition: service_started
required: true
rest:
condition: service_started
required: true
environment:
ANON_KEY: ${ANON_KEY}
AUTH_JWT_SECRET: ${JWT_SECRET}
DATABASE_URL: postgres://supabase_storage_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}
ENABLE_IMAGE_TRANSFORMATION: "true"
FILE_SIZE_LIMIT: ${STORAGE_FILE_SIZE_LIMIT:-1099511627776}
FILE_STORAGE_BACKEND_PATH: /var/lib/storage
GLOBAL_S3_BUCKET: ${GLOBAL_S3_BUCKET}
IMGPROXY_URL: http://imgproxy:5001
POSTGREST_URL: http://rest:3000
REGION: ${REGION}
REQUEST_ALLOW_X_FORWARDED_PATH: "true"
S3_PROTOCOL_ACCESS_KEY_ID: ${S3_PROTOCOL_ACCESS_KEY_ID}
S3_PROTOCOL_ACCESS_KEY_SECRET: ${S3_PROTOCOL_ACCESS_KEY_SECRET}
SERVICE_KEY: ${SERVICE_ROLE_KEY}
STORAGE_BACKEND: file
STORAGE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
TENANT_ID: ${STORAGE_TENANT_ID}
healthcheck:
interval: 5s
retries: 3
start_period: 10s
test:
- CMD
- wget
- --no-verbose
- --tries=1
- --spider
- http://storage:5000/status
timeout: 5s
image: supabase/storage-api:v1.60.4
networks:
default: null
restart: unless-stopped
volumes:
- bind:
create_host_path: true
selinux: z
source: /volume1/docker/timeamber/deploy/supabase/volumes/storage
target: /var/lib/storage
type: bind
studio:
container_name: supabase-studio
environment:
AUTH_JWT_SECRET: ${JWT_SECRET}
DEFAULT_ORGANIZATION_NAME: ${STUDIO_DEFAULT_ORGANIZATION}
DEFAULT_PROJECT_NAME: ${STUDIO_DEFAULT_PROJECT}
EDGE_FUNCTIONS_MANAGEMENT_FOLDER: /app/edge-functions
ENABLED_FEATURES_LOGS_ALL: "false"
HOSTNAME: 0.0.0.0
OPENAI_API_KEY: ${OPENAI_API_KEY}
PG_META_CRYPTO_KEY: ${PG_META_CRYPTO_KEY}
PGRST_DB_EXTRA_SEARCH_PATH: ${PGRST_DB_EXTRA_SEARCH_PATH:-public}
PGRST_DB_MAX_ROWS: ${PGRST_DB_MAX_ROWS:-1000}
PGRST_DB_SCHEMAS: ${PGRST_DB_SCHEMAS}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PORT: ${POSTGRES_PORT}
SNIPPETS_MANAGEMENT_FOLDER: /app/snippets
STUDIO_PG_META_URL: http://meta:8080
SUPABASE_ANON_KEY: ${ANON_KEY}
SUPABASE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
SUPABASE_PUBLISHABLE_KEY: ${SUPABASE_PUBLISHABLE_KEY}
SUPABASE_SECRET_KEY: ${SUPABASE_SECRET_KEY}
SUPABASE_SERVICE_KEY: ${SERVICE_ROLE_KEY}
SUPABASE_URL: http://kong:8000
healthcheck:
interval: 5s
retries: 3
start_period: 20s
test:
- CMD-SHELL
- node -e "fetch('http://localhost:3000/api/platform/profile').then((r) =>
{if (r.status !== 200) throw new Error(r.status)})"
timeout: 10s
image: supabase/studio:2026.06.03-sha-0bca601
networks:
default: null
profiles:
- admin
restart: unless-stopped
volumes:
- bind:
create_host_path: true
selinux: z
source: /volume1/docker/timeamber/deploy/supabase/volumes/snippets
target: /app/snippets
type: bind
- bind:
create_host_path: true
selinux: z
read_only: true
source: /volume1/docker/timeamber/deploy/supabase/volumes/functions
target: /app/edge-functions
type: bind
supavisor:
command:
- /bin/sh
- -c
- /app/bin/migrate && /app/bin/supavisor eval "$$(cat /etc/pooler/pooler.exs)"
&& /app/bin/server
container_name: supabase-pooler
depends_on:
db:
condition: service_healthy
required: true
environment:
API_JWT_SECRET: ${JWT_SECRET}
CLUSTER_POSTGRES: "true"
DATABASE_URL: ecto://supabase_admin:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/_supabase
DB_POOL_SIZE: ${POOLER_DB_POOL_SIZE}
ERL_AFLAGS: -proto_dist inet_tcp
METRICS_JWT_SECRET: ${JWT_SECRET}
POOLER_DEFAULT_POOL_SIZE: ${POOLER_DEFAULT_POOL_SIZE}
POOLER_MAX_CLIENT_CONN: ${POOLER_MAX_CLIENT_CONN}
POOLER_POOL_MODE: transaction
POOLER_TENANT_ID: ${POOLER_TENANT_ID}
PORT: 4000
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_HOST: ${POSTGRES_HOST}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_PORT: ${POSTGRES_PORT}
REGION: local
SECRET_KEY_BASE: ${SECRET_KEY_BASE}
VAULT_ENC_KEY: ${VAULT_ENC_KEY}
healthcheck:
interval: 10s
retries: 10
start_period: 30s
test:
- CMD
- curl
- -sSfL
- --head
- -o
- /dev/null
- http://127.0.0.1:4000/api/health
timeout: 5s
image: supabase/supavisor:2.9.5
networks:
default: null
ports:
- ${TAILSCALE_IP:-127.0.0.1}:${POOLER_PROXY_PORT_SESSION:-6548}:5432
- ${TAILSCALE_IP:-127.0.0.1}:${POOLER_PROXY_PORT_TRANSACTION}:6543
profiles:
- admin
restart: unless-stopped
volumes:
- bind:
create_host_path: true
selinux: z
read_only: true
source: /volume1/docker/timeamber/deploy/supabase/volumes/pooler/pooler.exs
target: /etc/pooler/pooler.exs
type: bind
timeamber-app:
build:
args:
VITE_SUPABASE_PUBLISHABLE_KEY: ${ANON_KEY}
VITE_SUPABASE_URL: ${SUPABASE_PUBLIC_URL}
context: /volume1/docker/timeamber
dockerfile: Dockerfile
container_name: timeamber-app
depends_on:
db:
condition: service_healthy
required: true
kong:
condition: service_healthy
required: true
environment:
AI_API_KEY: ${AI_API_KEY:-}
AI_BASE_URL: ${AI_BASE_URL:-}
AI_MODEL: ${AI_MODEL:-}
COOKIE_SECURE: "false"
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@db:${POSTGRES_PORT}/${POSTGRES_DB}
GITHUB_TOKEN: ${GITHUB_TOKEN:-}
MEDIA_ROOT: /data/media
NODE_ENV: production
PORT: 3000
SESSION_SECRET: ${SESSION_SECRET}
SUPABASE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
SUPABASE_PUBLISHABLE_KEY: ${ANON_KEY}
SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
SUPABASE_URL: http://kong:8000
TIMEAMBER_SECRET_KEY: ${TIMEAMBER_SECRET_KEY}
WORKER_SECRET: ${WORKER_SECRET}
WORKER_URL: http://timeamber-worker:3001
healthcheck:
interval: 30s
retries: 3
start_period: 30s
test:
- CMD
- node
- -e
- fetch('http://127.0.0.1:3000/').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))
timeout: 10s
networks:
default: null
ports:
- mode: ingress
protocol: tcp
published: "49287"
target: 3000
restart: unless-stopped
volumes:
- read_only: true
source: ${LEGACY_MEDIA_PATH}
target: /data/media
type: bind
volume: {}
# 后台本地上传的落盘目录:只有这一层可写,/data/media 仍是只读。
# 读取仍走 /cdn/uploads/*(由 node.mjs 从只读的 /data/media 静态伺服)。
- source: ${LEGACY_MEDIA_PATH}/uploads
target: /data/uploads
type: bind
volume: {}
timeamber-bootstrap:
build:
context: /volume1/docker/timeamber
dockerfile: Dockerfile
command:
- node
- /app/bootstrap.mjs
depends_on:
auth:
condition: service_healthy
required: true
environment:
ADMIN_EMAIL: ${ADMIN_EMAIL:-955555@gmail.com}
ADMIN_INITIAL_PASSWORD: ${ADMIN_INITIAL_PASSWORD}
SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
SUPABASE_URL: http://kong:8000
networks:
default: null
profiles:
- tools
volumes:
- bind:
create_host_path: true
read_only: true
source: /volume1/docker/timeamber/deploy/bootstrap.mjs
target: /app/bootstrap.mjs
type: bind
timeamber-media-import:
build:
context: /volume1/docker/timeamber
dockerfile: Dockerfile
command:
- node
- /app/migrate-media.mjs
depends_on:
storage:
condition: service_healthy
required: true
environment:
LEGACY_MEDIA_ROOT: /legacy-media
SUPABASE_PUBLIC_URL: ${SUPABASE_PUBLIC_URL}
SUPABASE_SERVICE_ROLE_KEY: ${SERVICE_ROLE_KEY}
SUPABASE_URL: http://kong:8000
networks:
default: null
profiles:
- tools
volumes:
- read_only: true
source: ${LEGACY_MEDIA_PATH}
target: /legacy-media
type: bind
volume: {}
- bind:
create_host_path: true
read_only: true
source: /volume1/docker/timeamber/deploy/migrate-media.mjs
target: /app/migrate-media.mjs
type: bind
timeamber-migrate:
depends_on:
db:
condition: service_healthy
required: true
entrypoint:
- /bin/bash
- -lc
- |
set -euo pipefail
if [ -f /import/legacy.dump ]; then
pg_restore --host db --port ${POSTGRES_PORT} --username postgres --dbname ${POSTGRES_DB} \
--no-owner --no-acl --clean --if-exists /import/legacy.dump
fi
for migration in /migrations/*.sql; do
echo "Applying $$(basename "$$migration")"
psql --host db --username postgres --dbname ${POSTGRES_DB} \
--port ${POSTGRES_PORT} \
--set ON_ERROR_STOP=1 --file "$$migration"
done
environment:
PGPASSWORD: ${POSTGRES_PASSWORD}
image: postgres:16-alpine
networks:
default: null
profiles:
- tools
volumes:
- bind:
create_host_path: true
read_only: true
source: /volume1/docker/timeamber/supabase/migrations
target: /migrations
type: bind
- bind:
create_host_path: true
read_only: true
source: /volume1/docker/timeamber/deploy/supabase/volumes/import
target: /import
type: bind
timeamber-worker:
build:
context: /volume1/docker/timeamber
dockerfile: Dockerfile.worker
container_name: timeamber-worker
depends_on:
db:
condition: service_healthy
required: true
environment:
BACKUP_ENABLED: "true"
BACKUP_RETENTION: "30"
BACKUP_ROOT: /data/backups
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD}@db:${POSTGRES_PORT}/${POSTGRES_DB}
KNOWLEDGE_INDEX_BATCH_SIZE: ${KNOWLEDGE_INDEX_BATCH_SIZE:-100}
MEDIA_ROOT: /data/media
NOTION_DATA_SOURCE_ID: ${NOTION_DATA_SOURCE_ID:-}
NOTION_TOKEN: ${NOTION_TOKEN:-}
SYNC_ENABLED: "true"
VS_DO_ARCHIVE_FOLDER_ID: ${VS_DO_ARCHIVE_FOLDER_ID:-}
VS_DO_BASE_URL: ${VS_DO_BASE_URL:-}
VS_DO_EMAIL: ${VS_DO_EMAIL:-}
VS_DO_PASSWORD: ${VS_DO_PASSWORD:-}
VS_DO_TOKEN: ${VS_DO_TOKEN:-}
WORKER_SECRET: ${WORKER_SECRET}
extra_hosts:
- host.docker.internal:host-gateway
healthcheck:
interval: 30s
retries: 3
start_period: 30s
test:
- CMD
- node
- -e
- fetch('http://127.0.0.1:3001/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))
timeout: 10s
networks:
default: null
restart: unless-stopped
volumes:
- source: ${LEGACY_MEDIA_PATH}
target: /data/media
type: bind
volume: {}
- bind:
create_host_path: true
source: /volume1/docker/timeamber/deploy/supabase/volumes/timeamber-backups
target: /data/backups
type: bind
volumes:
db-config:
name: timeamber_db-config
deno-cache:
name: timeamber_deno-cache