forked from wundergraph/cosmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.full.yml
304 lines (283 loc) · 8.17 KB
/
docker-compose.full.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
version: '3.8'
name: 'full-cosmo'
services:
# Services for the demo
employees:
container_name: employees
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
build:
context: ./demo
dockerfile: Dockerfile.employees
profiles:
- subgraphs
ports:
- '4001:4001'
networks:
- primary
family:
container_name: family
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
build:
context: ./demo
dockerfile: Dockerfile.family
profiles:
- subgraphs
ports:
- '4002:4002'
networks:
- primary
hobbies:
container_name: hobbies
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
build:
context: ./demo
dockerfile: Dockerfile.hobbies
profiles:
- subgraphs
ports:
- '4003:4003'
networks:
- primary
products:
environment:
OTEL_AUTH_TOKEN: ${OTEL_AUTH_TOKEN}
OTEL_HTTP_ENDPOINT: ${OTEL_HTTP_ENDPOINT:-otelcollector:4318}
container_name: products
build:
context: ./demo
dockerfile: Dockerfile.products
profiles:
- subgraphs
ports:
- '4004:4004'
networks:
- primary
# Infrastructure services
clickhouse:
image: clickhouse/clickhouse-server:${DC_CLICKHOUSE_VERSION:-23}
environment:
CLICKHOUSE_DB: ${CLICKHOUSE_DATABASE:-cosmo}
CLICKHOUSE_USER: ${CLICKHOUSE_USER:-default}
CLICKHOUSE_PASSWORD: ${CLICKHOUSE_PASSWORD:-changeme}
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: ${CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT:-1}
ports:
- "8123:8123"
- "9000:9000"
- "9440:9440"
profiles:
- default
networks:
- primary
volumes:
- clickhouse:/var/lib/clickhouse
- ./docker/clickhouse/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
postgres:
image: postgres:${DC_POSTGRESQL_VERSION:-15.3}
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
POSTGRES_DB: ${POSTGRES_DB:-controlplane}
PGDATA: /data/postgres
volumes:
- ./docker/postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
- postgres:/data/postgres
ports:
- "5432:5432"
profiles:
- default
restart: unless-stopped
networks:
- primary
keycloak:
image: ghcr.io/wundergraph/cosmo/keycloak:${DC_KEYCLOAK_VERSION:-latest}
platform: linux/amd64
environment:
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-changeme}
KC_DB: postgres
KC_DB_URL_HOST: postgres
KC_DB_URL_DATABASE: ${POSTGRES_DB:-keycloak}
KC_DB_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
KC_DB_USERNAME: ${POSTGRES_USER:-postgres}
KC_DB_SCHEMA: public
command:
- "start-dev"
- "--import-realm"
ports:
- "8080:8080"
volumes:
- ./docker/keycloak/realm.json:/opt/keycloak/data/import/realm.json:ro
restart: unless-stopped
networks:
- primary
profiles:
- default
depends_on:
- postgres
prometheus:
image: prom/prometheus:v2.46.0
command:
- --web.enable-remote-write-receiver
- --enable-feature=native-histograms
- --config.file=/etc/prometheus/prometheus.yml
- --web.config.file=/etc/prometheus/web.yml
volumes:
- prometheus:/prometheus
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./docker/prometheus/web.yml:/etc/prometheus/web.yml
networks:
- primary
profiles:
- default
ports:
- "9090:9090"
# Cosmo Platform
otelcollector:
# On the public repo
image: ghcr.io/wundergraph/cosmo/otelcollector:${DC_OTELCOLLECTOR_VERSION:-latest}
platform: linux/amd64
environment:
CLICKHOUSE_ENDPOINT: "clickhouse://${CLICKHOUSE_USER:-default}:${CLICKHOUSE_PASSWORD:-changeme}@clickhouse:9000/${CLICKHOUSE_DATABASE:-cosmo}?dial_timeout=15s&compress=lz4"
OTEL_INGEST_JWT_SECRET: ${OTEL_INGEST_JWT_SECRET:-fkczyomvdprgvtmvkuhvprxuggkbgwld}
PROMETHEUS_REMOTE_ENDPOINT: "http://prometheus:9090/api/v1/write"
PROMETHEUS_USERNAME: ${PROMETHEUS_USERNAME:-admin}
PROMETHEUS_PASSWORD: ${PROMETHEUS_PASSWORD:-test}
ports:
- '4318:4318'
restart: unless-stopped
profiles:
- default
depends_on:
- clickhouse
networks:
- primary
controlplane:
image: ghcr.io/wundergraph/cosmo/controlplane:${DC_CONTROLPLANE_VERSION:-latest}
platform: linux/amd64
environment:
DB_URL: "postgresql://postgres:changeme@postgres:5432/controlplane"
PORT: 3001
HOST: "0.0.0.0"
ALLOWED_ORIGINS: "http://localhost:3000"
LOG_LEVEL: "info"
DEBUG_SQL: "true"
CLICKHOUSE_DSN: "http://default:changeme@clickhouse:8123?database=cosmo"
AUTH_REDIRECT_URI: "http://localhost:3001/v1/auth/callback"
WEB_BASE_URL: "http://localhost:3000"
AUTH_JWT_SECRET: "fkczyomvdprgvtmvkuhvprxuggkbgwld"
KC_CLIENT_ID: "studio"
KC_REALM: "cosmo"
KC_ADMIN_USER: ${KEYCLOAK_ADMIN:-admin}
KC_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-changeme}
KC_API_URL: "http://keycloak:8080"
KC_FRONTEND_URL: "http://localhost:8080"
PROMETHEUS_API_URL: "http://admin:test@prometheus:9090/api/v1"
ports:
- '3001:3001'
restart: on-failure
networks:
- primary
profiles:
- default
depends_on:
- postgres
- clickhouse
router:
image: ghcr.io/wundergraph/cosmo/router:${DC_ROUTER_VERSION:-latest}
platform: linux/amd64
environment:
LOG_LEVEL: info
FEDERATED_GRAPH_NAME: production
CORS_ALLOW_CREDENTIALS: true
LISTEN_ADDR: "0.0.0.0:3002"
CONTROLPLANE_URL: http://controlplane:3001
TELEMETRY_ENDPOINT: http://otelcollector:4318
GRAPH_API_TOKEN: ${ROUTER_TOKEN}
restart: on-failure
networks:
- primary
profiles:
- router
ports:
- '3002:3002'
studio:
image: ghcr.io/wundergraph/cosmo/studio:${DC_STUDIO_VERSION:-latest}
platform: linux/amd64
environment:
NEXT_PUBLIC_COSMO_CP_URL: http://localhost:3001
HOSTNAME: "0.0.0.0"
profiles:
- default
ports:
- '3000:3000'
# Migrations & Seed
seed:
image: ghcr.io/wundergraph/cosmo/controlplane:${DC_CONTROLPLANE_VERSION:-latest}
platform: linux/amd64
command:
- "/app/dist/bin/seed.js"
environment:
KC_REALM: "cosmo"
KC_API_URL: "http://keycloak:8080"
KC_ADMIN_USER: "admin"
KC_ADMIN_PASSWORD: "changeme"
KC_CLIENT_ID: "studio"
API_KEY: cosmo_669b576aaadc10ee1ae81d9193425705
DB_URL: "postgresql://postgres:changeme@postgres:5432/controlplane"
USER_EMAIL: foo@wundergraph.com
USER_PASSWORD: bar
USER_FIRSTNAME: foo
USER_LASTNAME: bar
ORGANIZATION_NAME: wundergraph
ORGANIZATION_SLUG: wundergraph
restart: on-failure
networks:
- primary
profiles:
- default
depends_on:
- postgres
- clickhouse
- keycloak
clickhouse-migration:
image: ghcr.io/wundergraph/cosmo/controlplane:${DC_CONTROLPLANE_VERSION:-latest}
platform: linux/amd64
command: node dist/bin/ch-migrate.js
depends_on:
- clickhouse
environment:
- CLICKHOUSE_DSN=clickhouse://default:changeme@clickhouse:9000/cosmo
networks:
- primary
profiles:
- default
restart: on-failure
database-migration:
image: ghcr.io/wundergraph/cosmo/controlplane:${DC_CONTROLPLANE_VERSION:-latest}
platform: linux/amd64
command: node dist/bin/db-migrate.js
depends_on:
- postgres
environment:
- DB_URL=postgresql://postgres:changeme@postgres:5432/controlplane
networks:
- primary
profiles:
- default
restart: on-failure
# This network is shared between this file and docker-compose.yml to
# allow the demo subgraphs to communicate with the rest of the infra-networks:
networks:
primary:
driver: bridge
name: primary
volumes:
postgres:
clickhouse:
prometheus: