-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdocker-compose.dev.yml
More file actions
106 lines (102 loc) · 4.06 KB
/
Copy pathdocker-compose.dev.yml
File metadata and controls
106 lines (102 loc) · 4.06 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
# ---------------------------------------------------------------------------
# WARNING: the default credentials in this file are for local development
# only. The ONLY secret operators set directly is POSTGRES_PASSWORD. All
# cryptographic keys are generated by the trex-init service on first boot
# and written to ./secrets/{root.env,derived.env}.
# ---------------------------------------------------------------------------
volumes:
core-pgdata:
claude-config:
gh-config:
services:
trex-init:
build:
context: .
dockerfile: Dockerfile
image: ghcr.io/ohdsi/trexsql:dev
entrypoint: /usr/local/bin/trex-init
environment:
TREX_SECRETS_DIR: /shared
volumes:
- ./secrets:/shared
restart: "no"
postgres:
image: postgres:16
container_name: trexsql-postgres
ports:
- 65433:5432
command:
- postgres
- -c
- wal_level=logical
- -c
- max_replication_slots=10
- -c
- max_wal_senders=10
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-mypass}
POSTGRES_DB: testdb
volumes:
- core-pgdata:/var/lib/postgresql/data
- ./core/seed.sql:/docker-entrypoint-initdb.d/seed.sql
- ./core/schema:/docker-entrypoint-initdb.d/schema
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 10
trex:
build:
context: .
dockerfile: Dockerfile
image: ghcr.io/ohdsi/trexsql:dev
ports:
- 8000:8000
- 8001:8001
- 5433:5432
volumes:
# Mount source directories for live development (no rebuild needed)
- ./core/server:/usr/src/core/server
- ./core/event:/usr/src/core/event
- ./functions:/usr/src/functions
- ./plugins/web/dist:/usr/src/plugins-dev/web/dist
- ./plugins/notebook/dist:/usr/src/plugins-dev/notebook/dist
- ./plugins/prometheus/dist:/usr/src/plugins-dev/prometheus/dist
- ./plugins/storage:/usr/src/plugins-dev/storage
- ./plugins/postgrest:/usr/src/plugins-dev/postgrest
- ./plugins-dev/toy-agent:/usr/src/plugins-dev/toy-agent
- claude-config:/home/node/.claude
- gh-config:/home/node/.config/gh
depends_on:
trex-init:
condition: service_completed_successfully
postgres:
condition: service_healthy
env_file:
- path: ./secrets/root.env
required: false
- path: ./secrets/derived.env
required: false
environment:
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD:-mypass}@postgres:5432/testdb
BASE_PATH: /trex
BETTER_AUTH_URL: http://localhost:8001/trex
PLUGINS_INFORMATION_URL: "https://feeds.dev.azure.com/data2experience/d2e/_apis/packaging/Feeds/d2e/packages?api-version=7.1&includeDescription=true"
TPM_REGISTRY_URL: "https://pkgs.dev.azure.com/data2experience/d2e/_packaging/d2e/npm/registry"
PLUGINS_PATH: /usr/src/plugins
PLUGINS_DEV_PATH: /usr/src/plugins-dev
SCHEMA_DIR: /usr/src/core/schema
SWARM_CONFIG: >-
{"cluster_id":"local","nodes":{"local":{"gossip_addr":"0.0.0.0:4200","extensions":[{"name":"trexas","config":{"host":"0.0.0.0","port":8001,"main_service_path":"/usr/src/core/server","event_worker_path":"/usr/src/core/event","tls_port":8000,"tls_cert_path":"/usr/src/server.crt","tls_key_path":"/usr/src/server.key"}},{"name":"pgwire","config":{"host":"0.0.0.0","port":5432}}]}}}
SWARM_NODE: local
# REST is served in-process by the @trex/postgrest plugin, which
# consumes these PGRST_* values; PGRST_JWT_SECRET comes from
# ./secrets/derived.env (see env_file above).
PGRST_DB_URI: postgres://authenticator:authenticator_pass@postgres:5432/testdb
PGRST_DB_SCHEMAS: public
PGRST_DB_ANON_ROLE: anon
PGRST_DB_PRE_REQUEST: public.postgrest_pre_request
PGRST_OPENAPI_SERVER_PROXY_URI: http://localhost:8001/trex/rest/v1
# Register prometheus in the web shell's top nav (consumed by plugins/web).
TREX_WEB_NAV_EXTRA: '[{"path":"/prometheus","label":"Prometheus","plugin":"prometheus"}]'