forked from formancehq/stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
354 lines (335 loc) · 11 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
---
version: '3.9'
volumes:
postgres_data:
mongodb_data:
opensearch_data:
services:
otlp-exporter:
image: "otel/opentelemetry-collector"
gateway:
image: "traefik:v2.9"
network_mode: service:auth-dex
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
- "./config/traefik:/etc/traefik:ro"
auth-dex:
image: "ghcr.io/formancehq/auth-dex:v0.2.2"
restart: always
volumes:
- ./config/dex/dex-config.yaml:/etc/dex/config.docker.yaml
depends_on:
postgres:
condition: service_healthy
ports:
- "80:80"
- "8091:8081"
- "8080:8080"
labels:
- traefik.enable=true
- traefik.http.routers.dex.rule=Host(`localhost`) && PathPrefix(`/api/auth/dex`)
- traefik.http.routers.dex.entrypoints=web
- traefik.http.services.dex.loadbalancer.server.port=5556
- traefik.http.middlewares.cors.headers.accesscontrolallowmethods=GET,OPTIONS,PUT,POST,DELETE,HEAD,PATCH
- traefik.http.middlewares.cors.headers.accesscontrolalloworiginlist=*
- traefik.http.middlewares.cors.headers.accessControlAllowHeaders=content-type
- traefik.http.middlewares.cors.headers.accesscontrolmaxage=100
- traefik.http.middlewares.cors.headers.addvaryheader=true
- traefik.http.middlewares.jwt.plugin.auth.Issuer=http://localhost/api/auth
auth:
image: "ghcr.io/formancehq/auth:v0.2.3"
restart: always
network_mode: service:auth-dex
command: serve
depends_on:
postgres:
condition: service_healthy
environment:
DEBUG: true
CONFIG: ./config.yaml
POSTGRES_URI: host=postgres user=formance password=formance dbname=auth port=5432 sslmode=disable
CAOS_OIDC_DEV: 1
DELEGATED_CLIENT_ID: gateway
DELEGATED_CLIENT_SECRET: ZXhhbXBsZS1hcHAtc2VjcmV0
DELEGATED_ISSUER: http://localhost/api/auth/dex
BASE_URL: http://localhost/api/auth
volumes:
- ./config/auth/config.yaml:/config.yaml
labels:
- traefik.enable=true
- traefik.http.routers.auth.rule=Host(`localhost`) && PathPrefix(`/api/auth`)
- traefik.http.routers.auth.entrypoints=web
- traefik.http.services.auth.loadbalancer.server.port=8080
- traefik.http.middlewares.auth.stripprefix.prefixes=/api/auth
- traefik.http.routers.auth.middlewares=cors@docker,auth@docker
control:
image: "ghcr.io/formancehq/control:v1.3.0-rc.2"
restart: always
network_mode: service:gateway
environment:
API_URL: "http://localhost/api"
REDIRECT_URI: "http://localhost"
CLIENT_ID: "control"
CLIENT_SECRET: "mysupersecret"
ENCRYPTION_KEY: "mysuperencryptionkey"
ENCRYPTION_IV: "6f0c77c78a624022"
labels:
- traefik.enable=true
- traefik.http.routers.control.rule=Host(`localhost`)
- traefik.http.routers.control.entrypoints=web
- traefik.http.services.control.loadbalancer.server.port=3000
- traefik.http.routers.control.middlewares=cors@docker
redpanda:
image: "docker.vectorized.io/vectorized/redpanda:v22.2.7"
restart: always
command:
- redpanda
- start
- --smp
- '1'
- --reserve-memory
- 0M
- --overprovisioned
- --node-id
- '0'
- --kafka-addr
- PLAINTEXT://0.0.0.0:29092,OUTSIDE://0.0.0.0:9092
- --advertise-kafka-addr
- PLAINTEXT://redpanda:29092,OUTSIDE://localhost:9092
healthcheck:
test: curl -s -f -k http://127.0.0.1:9644/metrics >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 5
ports:
- "9092:9092"
- "29092:29092"
- "9644:9644"
redpanda-config:
image: "docker.vectorized.io/vectorized/redpanda:v22.2.7"
command:
- cluster
- config
- import
- --filename
- /etc/redpanda/redpanda.yaml
- --api-urls
- redpanda:9644
depends_on:
redpanda:
condition: service_healthy
volumes:
- ./config/redpanda/config.yaml:/etc/redpanda/redpanda.yaml:ro
redpanda-ui:
image: "docker.redpanda.com/vectorized/console:master-0a8fce8"
ports:
- "8081:8080"
depends_on:
redpanda:
condition: service_healthy
environment:
KAFKA_BROKERS: redpanda:29092
postgres:
image: "postgres:13-alpine"
restart: always
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ledger" ]
interval: 10s
timeout: 5s
retries: 5
ports:
- "5432:5432"
environment:
POSTGRES_USER: "formance"
POSTGRES_PASSWORD: "formance"
POSTGRES_MULTIPLE_DATABASES: "auth,ledger"
PGDATA: /data/postgres
volumes:
- postgres_data:/data/postgres
- ./config/postgres:/docker-entrypoint-initdb.d
ledger:
image: "ghcr.io/formancehq/ledger:v1.8.0"
restart: always
depends_on:
postgres:
condition: service_healthy
redpanda:
condition: service_healthy
environment:
NUMARY_STORAGE_DRIVER: "postgres"
NUMARY_STORAGE_POSTGRES_CONN_STRING: "postgresql://formance:formance@postgres/ledger"
NUMARY_SERVER_HTTP_BIND_ADDRESS: "0.0.0.0:3068"
NUMARY_PUBLISHER_KAFKA_ENABLED: "true"
NUMARY_PUBLISHER_KAFKA_BROKER: redpanda:29092
NUMARY_PUBLISHER_TOPIC_MAPPING: "*:ledger"
labels:
- traefik.enable=true
- traefik.http.routers.ledger.rule=Host(`localhost`) && PathPrefix(`/api/ledger`)
- traefik.http.routers.ledger.entrypoints=web
- traefik.http.services.ledger.loadbalancer.server.port=3068
- traefik.http.routers.ledger.middlewares=jwt@docker,ledger@docker,cors@docker
- traefik.http.middlewares.ledger.stripprefix.prefixes=/api/ledger
mongodb:
image: bitnami/mongodb:4.4
platform: linux/amd64
restart: always
environment:
MONGODB_ROOT_PASSWORD: root
MONGODB_REPLICA_SET_MODE: primary
MONGODB_REPLICA_SET_KEY: abcdef
MONGODB_ADVERTISED_HOSTNAME: mongodb
volumes:
- 'mongodb_data:/bitnami/mongodb'
ports:
- "27017:27017"
healthcheck:
test: [ "CMD", "mongo", "--eval", "db.adminCommand('ping')" ]
interval: 10s
timeout: 5s
retries: 5
payments:
image: "ghcr.io/formancehq/payments:v0.2.2"
restart: always
depends_on:
mongodb:
condition: service_healthy
redpanda:
condition: service_healthy
environment:
MONGODB_URI: "mongodb://root:root@mongodb:27017"
PUBLISHER_KAFKA_ENABLED: "true"
PUBLISHER_KAFKA_BROKER: redpanda:29092
PUBLISHER_TOPIC_MAPPING: "*:payments"
labels:
- traefik.enable=true
- traefik.http.routers.payments.rule=Host(`localhost`) && PathPrefix(`/api/payments`)
- traefik.http.routers.payments.entrypoints=web
- traefik.http.services.payments.loadbalancer.server.port=8080
- traefik.http.routers.payments.middlewares=jwt@docker,payments@docker,cors@docker
- traefik.http.middlewares.payments.stripprefix.prefixes=/api/payments
opensearch:
image: "opensearchproject/opensearch:2.1.0"
restart: always
environment:
discovery.type: single-node
plugins.security.disabled: "true"
healthcheck:
test: curl -s -f -k http://opensearch:9200/_cat/health >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 5
volumes:
- opensearch_data:/usr/share/opensearch/data
opensearch-dashboards:
image: "opensearchproject/opensearch-dashboards:2.1.0"
environment:
OPENSEARCH_HOSTS: '["http://opensearch:9200"]' # must be a string with no spaces when specified as an environment variable
DISABLE_SECURITY_DASHBOARDS_PLUGIN: "true"
depends_on:
opensearch:
condition: service_healthy
ports:
- "5601:5601"
search-ingester:
image: "ghcr.io/formancehq/search-ingester:v0.3.0"
restart: always
depends_on:
opensearch:
condition: service_healthy
redpanda:
condition: service_healthy
search:
condition: service_healthy
environment:
KAFKA_ADDRESS: redpanda:29092
KAFKA_TOPIC: ledger,payments
KAFKA_VERSION: 1.0.0
KAFKA_CONSUMER_GROUP: search-ingester
OPENSEARCH_URL: http://opensearch:9200
OPENSEARCH_INDEX: "formance"
OPENSEARCH_TLS_ENABLED: "true"
OPENSEARCH_TLS_SKIP_CERT_VERIFY: "true"
OPENSEARCH_BASIC_AUTH_ENABLED: "false"
search:
image: "ghcr.io/formancehq/search:v0.3.0"
restart: always
healthcheck:
test: curl -s -f -k http://127.0.0.1:8080/_healthcheck >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 5
depends_on:
opensearch:
condition: service_healthy
environment:
OPEN_SEARCH_SCHEME: http
OPEN_SEARCH_SERVICE: "opensearch:9200"
ES_INDICES: "formance"
labels:
- traefik.enable=true
- traefik.http.routers.search.rule=Host(`localhost`) && PathPrefix(`/api/search`)
- traefik.http.routers.search.entrypoints=web
- traefik.http.services.search.loadbalancer.server.port=8080
- traefik.http.routers.search.middlewares=jwt@docker,search@docker,cors@docker
- traefik.http.middlewares.search.stripprefix.prefixes=/api/search
webhooks:
image: "ghcr.io/formancehq/webhooks:v0.2.3"
restart: always
healthcheck:
test: curl -s -f -k http://127.0.0.1:8080/_healthcheck >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 5
depends_on:
redpanda:
condition: service_healthy
mongodb:
condition: service_healthy
environment:
STORAGE_MONGO_CONN_STRING: "mongodb://root:root@mongodb:27017"
labels:
- traefik.enable=true
- traefik.http.routers.webhooks.rule=Host(`localhost`) && PathPrefix(`/api/webhooks`)
- traefik.http.routers.webhooks.entrypoints=web
- traefik.http.services.webhooks.loadbalancer.server.port=8080
- traefik.http.routers.webhooks.middlewares=jwt@docker,webhooks@docker,cors@docker
- traefik.http.middlewares.webhooks.stripprefix.prefixes=/api/webhooks
webhooks-worker:
image: "ghcr.io/formancehq/webhooks:v0.2.3"
command: worker messages
restart: always
healthcheck:
test: curl -s -f -k http://127.0.0.1:8081/_healthcheck >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 5
depends_on:
redpanda:
condition: service_healthy
mongodb:
condition: service_healthy
environment:
STORAGE_MONGO_CONN_STRING: "mongodb://root:root@mongodb:27017"
KAFKA_BROKERS: "redpanda:29092"
KAFKA_TOPICS: "ledger,payments"
LOG_LEVEL: "debug"
labels:
- traefik.enable=false
webhooks-retries:
image: "ghcr.io/formancehq/webhooks:v0.2.3"
command: worker retries
restart: always
healthcheck:
test: curl -s -f -k http://127.0.0.1:8082/_healthcheck >/dev/null || exit 1
interval: 30s
timeout: 10s
retries: 5
depends_on:
redpanda:
condition: service_healthy
mongodb:
condition: service_healthy
environment:
STORAGE_MONGO_CONN_STRING: "mongodb://root:root@mongodb:27017"
labels:
- traefik.enable=false