-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev.docker-compose.yml
258 lines (245 loc) · 9.97 KB
/
dev.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
version: "3.7"
services:
postgres:
container_name: postgres
profiles: [ "all", "starlabs", "tests", "kafka" ]
image: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-password}
POSTGRES_DB: ${POSTGRES_DB:-postgres}
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
ports:
- "5432:5432"
restart: unless-stopped
healthcheck:
test:
[
"CMD-SHELL",
"sh -c 'pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}'"
]
interval: 10s
timeout: 3s
retries: 3
tfv2_frontend:
profiles: [ "all", "frontend" ]
container_name: tfv2_frontend
build:
context: ./frontend
target: local
args:
REACT_APP_API_URL: ${FRONTEND_REACT_APP_API_URL:-http://localhost:8080}
REACT_APP_SENTRY_DSN: ${SENTRY_DSN:-https://[email protected]/0}
environment:
REACT_APP_API_URL: ${FRONTEND_REACT_APP_API_URL:-http://localhost:8080}
REACT_APP_SENTRY_DSN: ${SENTRY_DSN:-https://[email protected]/0}
volumes:
- ./frontend/:/app
- node_modules_tfv2_frontend:/app/node_modules
ports:
- 3000:3000
backend:
platform: linux/amd64
profiles: [ "all", "tests" ]
container_name: token-factory-v2
build:
context: ./backend
dockerfile: dev.Dockerfile
image: mullberry-backend
ports:
- "8080:8080"
volumes:
- ./:/go/src/CheesecakeLabs/token-factory-v2/backend
depends_on:
postgres:
condition: service_healthy
stellar-kms:
platform: linux/amd64
profiles: [ "all", "starlabs", "tests" ]
container_name: kms
build:
context: ./stellar-kms
dockerfile: dev.Dockerfile
volumes:
- ".:/workspace"
environment:
KAFKA_ENABLED: ${KAFKA_ENABLED:-True}
KAFKA_CLIENT_GROUP_ID: ${KAFKA_CLIENT_GROUP_ID:-starlabs}
KAFKA_CLIENT_BROKERS: ${KAFKA_CLIENT_BROKERS:-kafka1:19092}
KAFKA_CREATE_KP_CONSUMER_TOPICS: ${KMS_KAFKA_CONSUMER_TOPICS:-generateKeypair}
KAFKA_CREATE_KP_PRODUCER_TOPIC: ${KMS_KAFKA_PRODUCER_TOPIC:-generatedKeypairs}
KAFKA_SIGN_CONSUMER_TOPICS: ${KAFKA_SIGN_CONSUMER_TOPICS:-signEnvelope}
KAFKA_SIGN_PRODUCER_TOPIC: ${KAFKA_SIGN_PRODUCER_TOPIC:-signedEnvelopes}
KAFKA_SIGN_SOROBAN_CONSUMER_TOPICS: ${KAFKA_SIGN_SOROBAN_CONSUMER_TOPICS:-signSorobanEnvelope}
KAFKA_SIGN_SOROBAN_PRODUCER_TOPIC: ${KAFKA_SIGN_SOROBAN_PRODUCER_TOPIC:-signedSorobanEnvelopes}
PG_HOST: ${PG_HOST:-postgres}
PG_PORT: ${PG_PORT:-5432}
PG_USER: ${PG_USER:-postgres}
PG_PASSWORD: ${PG_PASSWORD:-password}
PG_DB_NAME: ${PG_DATABASE:-postgres}
MASTER_KEY: ${MASTER_KEY:-da52f130e6fd477256b0c554aba89503}
LOG_LEVEL: ${LOG_LEVEL:-debug}
depends_on:
postgres:
condition: service_healthy
kafka1:
condition: service_healthy
zoo1:
profiles: [ "all", "starlabs", "tests", "kafka" ]
image: confluentinc/cp-zookeeper:7.5.3
hostname: zoo1
container_name: zoo1
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_SERVERS: zoo1:2888:3888
kafka1:
profiles: [ "all", "starlabs", "tests", "kafka" ]
image: confluentinc/cp-kafka:7.5.3
hostname: kafka1
container_name: kafka1
ports:
- "9092:9092"
- "29092:29092"
- "9999:9999"
environment:
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka1:19092,EXTERNAL://${DOCKER_HOST_IP:-127.0.0.1}:9092,DOCKER://host.docker.internal:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,DOCKER:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_ZOOKEEPER_CONNECT: "zoo1:2181"
KAFKA_BROKER_ID: 1
KAFKA_LOG4J_LOGGERS: "kafka.controller=INFO,kafka.producer.async.DefaultEventHandler=INFO,state.change.logger=INFO"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_JMX_PORT: 9999
KAFKA_JMX_HOSTNAME: ${DOCKER_HOST_IP:-127.0.0.1}
KAFKA_AUTHORIZER_CLASS_NAME: kafka.security.authorizer.AclAuthorizer
KAFKA_ALLOW_EVERYONE_IF_NO_ACL_FOUND: "true"
depends_on:
- zoo1
healthcheck:
test: nc -z kafka1 19092 || exit -1
start_period: 30s
interval: 10s
timeout: 10s
retries: 20
#Kafka - Schema Registry#
schema_registry:
profiles: [ "all", "kafka", "starlabs", "kms" ]
image: confluentinc/cp-schema-registry:7.5.3
container_name: schema_registry
ports:
- "8085:8085"
environment:
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8085
SCHEMA_REGISTRY_HOST_NAME: schema_registry
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zoo1:2181
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_ORIGIN: "*"
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_METHODS: "GET,POST,PUT,OPTIONS"
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka1:19092
healthcheck:
start_period: 10s
interval: 10s
retries: 20
test: curl --user superUser:superUser --fail --silent --insecure http://schema_registry:8085/subjects --output /dev/null || exit 1
depends_on:
kafka1:
condition: service_healthy
#Kafka - Init#
kafka_init:
profiles: [ "all", "kafka", "starlabs", "kms" ]
image: confluentinc/cp-kafka:7.5.3
container_name: kafka_init
entrypoint: [ "/bin/sh", "-c" ]
environment:
KAFKA_CREATE_KP_PRODUCER_TOPIC: ${KAFKA_CREATE_KP_PRODUCER_TOPIC:-generateKeypair}
KAFKA_CREATE_KP_CONSUMER_TOPICS: ${KAFKA_CREATE_KP_CONSUMER_TOPICS:-generatedKeypairs}
KAFKA_ENVELOPE_PRODUCER_TOPIC: ${KAFKA_ENVELOPE_PRODUCER_TOPIC:-createEnvelope}
KAFKA_ENVELOPE_CONSUMER_TOPICS: ${KAFKA_ENVELOPE_CONSUMER_TOPICS:-submitResponse}
KAFKA_HORIZON_PRODUCER_TOPIC: ${KAFKA_HORIZON_PRODUCER_TOPIC:-horizonRequest}
KAFKA_HORIZON_CONSUMER_TOPICS: ${KAFKA_HORIZON_CONSUMER_TOPICS:-horizonResponse}
SIGNED_SOROBAN_PRODUCER_TOPIC: ${SIGNED_SOROBAN_PRODUCER_TOPIC:-signSorobanEnvelope}
SIGNED_SOROBAN_CONSUMER_TOPICS: ${SIGNED_SOROBAN_CONSUMER_TOPICS:-signedSorobanEnvelopes}
KAFKA_HORIZON_SIGNED_ENVELOPES_TOPICS: ${KAFKA_HORIZON_SIGNED_ENVELOPES_TOPICS:-signedEnvelopes}
KAFKA_HORIZON_SIGN_ENVLOPES_TOPICS: ${KAFKA_HORIZON_SIGN_ENVLOPES_TOPICS:-signEnvelope}
depends_on:
kafka1:
condition: service_healthy
command: |
"
# blocks until kafka is reachable
kafka-topics --bootstrap-server kafka1:19092 --list
kafka-topics --create --topic $$KAFKA_CREATE_KP_PRODUCER_TOPIC --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka-topics --create --topic $$KAFKA_CREATE_KP_CONSUMER_TOPICS --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka-topics --create --topic $$KAFKA_ENVELOPE_PRODUCER_TOPIC --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka-topics --create --topic $$KAFKA_ENVELOPE_CONSUMER_TOPICS --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka-topics --create --topic $$KAFKA_HORIZON_PRODUCER_TOPIC --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka-topics --create --topic $$KAFKA_HORIZON_CONSUMER_TOPICS --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka-topics --create --topic $$KAFKA_HORIZON_SIGNED_ENVELOPES_TOPICS --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka-topics --create --topic $$KAFKA_HORIZON_SIGN_ENVLOPES_TOPICS --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka-topics --create --topic $$SIGNED_SOROBAN_PRODUCER_TOPIC --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka-topics --create --topic $$SIGNED_SOROBAN_CONSUMER_TOPICS --partitions 1 --replication-factor 1 --if-not-exists --bootstrap-server kafka1:19092
kafka1 cub kafka-ready -b kafka1:129092 1 20
"
# Kafka - UI#
kafka_ui:
profiles: [ "all", "kafka", "starlabs", "kms" ]
image: provectuslabs/kafka-ui
container_name: kafka_ui
ports:
- "9093:9093"
environment:
SERVER_PORT: 9093
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka1:19092
KAFKA_CLUSTERS_0_ZOOKEEPER: zoo1:2181
AUTH_TYPE: "LOGIN_FORM"
SPRING_SECURITY_USER_NAME: admin
SPRING_SECURITY_USER_PASSWORD: admin
depends_on:
kafka1:
condition: service_healthy
#Starlabs Service#
starlabs:
platform: linux/amd64
profiles: [ "all", "starlabs", "tests" ]
container_name: starlabs
build:
context: ./starlabs
dockerfile: Dev.Dockerfile
volumes:
- ".:/workspace"
environment:
KAFKA_ENABLED: ${KAFKA_ENABLED:-True}
KAFKA_CLIENT_GROUP_ID: ${KAFKA_CLIENT_GROUP_ID:-starlabs}
KAFKA_CLIENT_BROKERS: ${KAFKA_CLIENT_BROKERS:-kafka1:19092}
KAFKA_HORIZON_CONSUMER_TOPICS: ${KAFKA_CONSUMER_TOPICS:-horizonRequest}
KAFKA_HORIZON_PRODUCER_TOPIC: ${KAFKA_PRODUCER_TOPIC:-horizonResponse}
KAFKA_ENVELOPE_CONSUMER_TOPICS: ${KAFKA_ENVELOPE_CONSUMER_TOPICS:-createEnvelope}
KAFKA_ENVELOPE_PRODUCER_TOPIC: ${KAFKA_ENVELOPE_PRODUCER_TOPIC:-signEnvelope}
KAFKA_SUBMIT_CONSUMER_TOPICS: ${KAFKA_SUBMIT_CONSUMER_TOPICS:-signedEnvelopes}
KAFKA_SUBMIT_PRODUCER_TOPIC: ${KAFKA_SUBMIT_PRODUCER_TOPIC:-submitResponse}
LOG_LEVEL: ${LOG_LEVEL:-debug}
depends_on:
kafka1:
condition: service_healthy
integration:
profiles: [ "tests" ]
platform: linux/amd64
build:
context: ./backend
dockerfile: integration-test/Dockerfile
container_name: integration
image: integration
depends_on:
- backend
- stellar-kms
- starlabs
volumes:
postgres:
node_modules_tfv2_frontend: