forked from wundergraph/cosmo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
248 lines (234 loc) · 6.91 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
version: '3.8'
name: cosmo-dev
services:
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'
restart: unless-stopped
networks:
- primary
profiles:
- dev
keycloak:
build:
context: keycloak
dockerfile: Dockerfile
environment:
KEYCLOAK_EXTRA_ARGS: '--import-realm --health-enabled=true'
KEYCLOAK_ADMIN: ${KEYCLOAK_ADMIN:-admin}
KEYCLOAK_ADMIN_PASSWORD: ${KEYCLOAK_ADMIN_PASSWORD:-changeme}
KEYCLOAK_DATABASE_PORT: ${POSTGRES_PORT:-5432}
KEYCLOAK_DATABASE_HOST: ${POSTGRES_HOST:-postgres}
KEYCLOAK_DATABASE_NAME: ${POSTGRES_DB_NAME:-keycloak}
KEYCLOAK_DATABASE_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
KEYCLOAK_DATABASE_USER: ${POSTGRES_USER:-postgres}
ports:
- '8080:8080'
volumes:
- ./docker/keycloak/realm.json:/opt/bitnami/keycloak/data/import/realm.json:ro
restart: unless-stopped
depends_on:
- postgres
networks:
- primary
profiles:
- dev
# Only to test OTEL Instrumentation
jaeger:
image: jaegertracing/all-in-one:latest
ports:
- '16686:16686'
- '14268:14268'
- '4319:4318'
environment:
- COLLECTOR_OTLP_ENABLED=true
- LOG_LEVEL=debug
networks:
- primary
profiles:
- debug
# Only to test prometheus integration
prometheus:
image: prom/prometheus:v2.51.1
command:
- --web.enable-remote-write-receiver
- --enable-feature=native-histograms
- --config.file=/etc/prometheus/prometheus.yml
- --web.config.file=/etc/prometheus/web.yml
networks:
- primary
volumes:
- prometheus:/prometheus
- ./docker/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./docker/prometheus/web.yml:/etc/prometheus/web.yml
extra_hosts:
# https://medium.com/@TimvanBaarsen/how-to-connect-to-the-docker-host-from-inside-a-docker-container-112b4c71bc66
- 'host.docker.internal:host-gateway'
ports:
- '9090:9090'
profiles:
- debug
graphqlmetrics:
image: ghcr.io/wundergraph/cosmo/graphqlmetrics:${DC_GRAPHQLMETRICS_VERSION:-latest}
build:
context: graphqlmetrics
dockerfile: Dockerfile
environment:
CLICKHOUSE_DSN: 'clickhouse://${CLICKHOUSE_USER:-default}:${CLICKHOUSE_PASSWORD:-changeme}@clickhouse:9000/${CLICKHOUSE_DATABASE:-cosmo}'
INGEST_JWT_SECRET: ${INGEST_JWT_SECRET:-fkczyomvdprgvtmvkuhvprxuggkbgwld}
LISTEN_ADDR: '0.0.0.0:4005'
ports:
- '4005:4005'
restart: unless-stopped
depends_on:
- clickhouse
networks:
- primary
profiles:
- dev
otelcollector:
build:
context: otelcollector
dockerfile: Dockerfile
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}
ports:
- '4317:4317' # otlpgrpc
- '4318:4318' # otlphttp
- '8888:8888' # prometheus metrics
restart: unless-stopped
depends_on:
- clickhouse
networks:
- primary
profiles:
- dev
clickhouse:
image: clickhouse/clickhouse-server:${DC_CLICKHOUSE_VERSION:-24.2.2}
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'
volumes:
- clickhouse:/var/lib/clickhouse
- ./docker/clickhouse/init-db.sh:/docker-entrypoint-initdb.d/init-db.sh
networks:
- primary
profiles:
- dev
minio:
image: quay.io/minio/minio:${DC_MINIO_VERSION:-RELEASE.2023-11-06T22-26-08Z}
environment:
- MINIO_ROOT_USER=${MINIO_ROOT_USER:-minio}
- MINIO_ROOT_PASSWORD=${MINIO_ROOT_PASSWORD:-changeme}
ports:
- '10000:9000'
- '10001:9001'
volumes:
- minio:/data
- ./docker/minio/entrypoint.sh:/entrypoint.sh
entrypoint: /entrypoint.sh
networks:
- primary
profiles:
- dev
cdn:
build:
context: .
dockerfile: cdn-server/Dockerfile
environment:
- PORT=11000
- AUTH_JWT_SECRET=fkczyomvdprgvtmvkuhvprxuggkbgwld
- AUTH_ADMISSION_JWT_SECRET=uXDxJLEvrw4aafPfrf3rRotCoBzRfPEW
- S3_STORAGE_URL=http://${MINIO_ROOT_USER:-minio}:${MINIO_ROOT_PASSWORD:-changeme}@minio:9000/cosmo
ports:
- '11000:11000'
networks:
- primary
profiles:
- dev
nats:
image: nats:${DC_NATS_VERSION:-2.10.6}
ports:
- '4222:4222'
- '8222:8222'
- '6222:6222'
command:
- "--js"
networks:
- primary
profiles:
- edfs
redis:
image: redis:${DC_REDIS_VERSION:-7.2.4}-alpine
ports:
- '6379:6379'
command: redis-server /usr/local/etc/redis/redis.conf
volumes:
- ./docker/redis/redis.conf:/usr/local/etc/redis/redis.conf
- redis:/data
networks:
- primary
profiles:
- dev
redis-slave:
image: redis:${DC_REDIS_VERSION:-7.2.4}-alpine
ports:
- '6380:6379'
command: redis-server /usr/local/etc/redis/redis.conf
depends_on:
- redis
volumes:
- ./docker/redis/redis-slave.conf:/usr/local/etc/redis/redis.conf
- redis-slave:/data
networks:
- primary
profiles:
- dev
kafka:
image: bitnami/kafka:3.7.0
ports:
- "9092:9092"
environment:
KAFKA_ENABLE_KRAFT: yes
KAFKA_CFG_PROCESS_ROLES: controller,broker
KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_CFG_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@localhost:9093
KAFKA_CFG_TRANSACTION_PARTITION_VERIFICATION_ENABLE: false
# Set this to "PLAINTEXT://127.0.0.1:9092" if you want to run this container on localhost via Docker
KAFKA_CFG_ADVERTISED_LISTENERS: PLAINTEXT://localhost:9092
KAFKA_CFG_NODE_ID: 1
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_KRAFT_CLUSTER_ID: XkpGZQ27R3eTl3OdTm2LYA # 16 byte base64-encoded UUID
profiles:
- edfs
# This network is shared between this file and docker-compose.full.yml to
# allow the demo subgraphs to communicate with the rest of the infra
networks:
primary:
driver: bridge
name: primary
volumes:
postgres:
clickhouse:
prometheus:
minio:
redis:
redis-slave: