forked from oskardudycz/EventSourcing.NetCore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
246 lines (232 loc) · 8.44 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
version: "3"
services:
#######################################################
# Postgres
#######################################################
postgres:
profiles: [ postgres, postgres-all, all, all-no-ui, ci ]
image: postgres:15.1-alpine
container_name: postgres
environment:
- POSTGRES_DB=postgres
- POSTGRES_PASSWORD=Password12!
ports:
- "5432:5432"
networks:
- postgres
pgadmin:
profiles: [ postgres-ui, postgres-all, all ]
image: dpage/pgadmin4
container_name: pgadmin
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL:[email protected]}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD:-admin}
ports:
- "${PGADMIN_PORT:-5050}:80"
networks:
- postgres
jaeger:
profiles: [ otel, otel-all, all ]
image: jaegertracing/all-in-one:latest
ports:
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
- "16686:16686"
- "14268:14268"
- "9411:9411"
#######################################################
# EventStoreDB
#######################################################
eventstore.db:
profiles: [ eventstoredb, eventstoredb-all, all, all-no-ui, ci ]
image: eventstore/eventstore:23.10.0-bookworm-slim
# use this image if you're running ARM-based proc like Apple M1
# image: eventstore/eventstore:23.10.0-alpha-arm64v8
environment:
- EVENTSTORE_CLUSTER_SIZE=1
- EVENTSTORE_RUN_PROJECTIONS=All
- EVENTSTORE_START_STANDARD_PROJECTIONS=true
- EVENTSTORE_EXT_TCP_PORT=1113
- EVENTSTORE_HTTP_PORT=2113
- EVENTSTORE_INSECURE=true
- EVENTSTORE_ENABLE_EXTERNAL_TCP=true
- EVENTSTORE_ENABLE_ATOM_PUB_OVER_HTTP=true
ports:
- '1113:1113'
- '2113:2113'
volumes:
- type: volume
source: eventstore-volume-data
target: /var/lib/eventstore
- type: volume
source: eventstore-volume-logs
target: /var/log/eventstore
networks:
- esdb_network
#######################################################
# Elastic Search
#######################################################
elasticsearch:
image: docker.elastic.co/elasticsearch/elasticsearch:8.13.2
profiles: [ elastic, elastic-all, all, all-no-ui, ci ]
environment:
- discovery.type=single-node
- cluster.name=docker-cluster
- node.name=docker-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
- xpack.security.enabled=false
- xpack.security.http.ssl.enabled=false
- xpack.security.transport.ssl.enabled=false
- network.host=0.0.0.0
- http.port=9200
- transport.host=localhost
- bootstrap.memory_lock=true
- cluster.routing.allocation.disk.threshold_enabled=false
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- elastic-data:/usr/share/elasticsearch/data
ports:
- "9200:9200"
- "9300:9300"
networks:
- es_network
kibana:
image: docker.elastic.co/kibana/kibana:8.13.2
profiles: [ elastic-ui, elastic-all, all ]
environment:
- ELASTICSEARCH_HOSTS=http://elastic_search:9200
ports:
- "5601:5601"
networks:
- es_network
depends_on:
- elasticsearch
#######################################################
# Kafka
#######################################################
kafka:
image: confluentinc/confluent-local:7.6.1
profiles: [kafka, kafka-all, all, all-no-ui]
hostname: kafka
container_name: kafka
networks:
- kafka_network
ports:
- "9092:9092"
- "9091:9091"
healthcheck:
test: nc -z localhost 9092 || exit -1
interval: 5s
timeout: 10s
retries: 100
environment:
KAFKA_NODE_ID: 1
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: 'CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT'
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
ADVERTISED_HOST_NAME: kafka
KAFKA_ADVERTISED_HOSTNAME: 127.0.0.1
KAFKA_JMX_PORT: 9101
KAFKA_JMX_HOSTNAME: localhost
KAFKA_PROCESS_ROLES: 'broker,controller'
KAFKA_CONTROLLER_QUORUM_VOTERS: '1@kafka:29093'
KAFKA_LISTENERS: 'PLAINTEXT://kafka:29092,CONTROLLER://kafka:29093,PLAINTEXT_HOST://0.0.0.0:9092'
KAFKA_INTER_BROKER_LISTENER_NAME: 'PLAINTEXT'
KAFKA_CONTROLLER_LISTENER_NAMES: 'CONTROLLER'
KAFKA_LOG_DIRS: '/tmp/kraft-combined-logs'
init-kafka:
image: confluentinc/confluent-local:7.6.1
profiles: [ kafka, kafka-all, all, all-no-ui ]
hostname: init-kafka
container_name: init-kafka
depends_on:
- kafka
entrypoint: [ '/bin/sh', '-c' ]
networks:
- kafka_network
command: |
"
# blocks until kafka is reachable
kafka-topics --bootstrap-server kafka:29092 --list
echo -e 'Creating kafka topics'
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic Carts --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic Orders --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic Payments --replication-factor 1 --partitions 1
kafka-topics --bootstrap-server kafka:29092 --create --if-not-exists --topic Shipments --replication-factor 1 --partitions 1
echo -e 'Successfully created the following topics:'
kafka-topics --bootstrap-server kafka:29092 --list
"
#######################################################
# Schema Registry
#######################################################
schema_registry:
image: confluentinc/cp-schema-registry:7.6.1
container_name: schema_registry
hostname: schema_registry
profiles: [ kafka-ui, kafka-all, all ]
ports:
- 8181:8181
- 8081:8081
depends_on:
- kafka
networks:
- kafka_network
environment:
SCHEMA_REGISTRY_HOST_NAME: schema_registry
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: 'kafka:29092'
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_METHODS: 'GET,POST,PUT,OPTIONS'
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_ORIGIN: '*'
SCHEMA_LOG4J_ROOT_LOGLEVEL: 'ERROR'
SCHEMA_TOOLS_LOG4J_LOGLEVEL: 'ERROR'
kafka_topics_ui:
image: provectuslabs/kafka-ui:latest
hostname: kafka-ui
profiles: [ kafka-ui, kafka-all, all ]
ports:
- "8080:8080"
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
networks:
- kafka_network
depends_on:
- kafka
#######################################################
# Test Backend Service
#######################################################
backend:
build:
dockerfile: Dockerfile
context: .
container_name: event_sourcing_sample
profiles: [sample]
ports:
- "5555:5000"
depends_on:
postgres:
condition: service_healthy
networks:
- postgres
networks:
es_network:
driver: bridge
postgres:
driver: bridge
esdb_network:
driver: bridge
kafka_network:
driver: bridge
volumes:
postgres:
pgadmin:
eventstore-volume-data:
eventstore-volume-logs:
elastic-data: