-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
206 lines (189 loc) · 5.69 KB
/
docker-compose.yml
File metadata and controls
206 lines (189 loc) · 5.69 KB
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
networks:
burraco-net:
driver: bridge
volumes:
redpanda-hd0: null
kurrentdb-volume-data: null
kurrentdb-volume-logs: null
services:
base-builder:
build:
context: .
dockerfile: DockerFile-base
image: base-builder
game:
build:
context: Game
dockerfile: Dockerfile
depends_on:
base-builder:
condition: service_completed_successfully
eventstore:
condition: service_healthy
redpanda:
condition: service_started
environment:
KAFKA_BOOTSTRAP_SERVERS: "redpanda:9092"
EVENTSTORE_CONNECTION_STRING: "kurrentdb://eventstore:2113?tls=false&tlsVerifyCert=false"
ports:
- "8081:8081"
networks:
burraco-net:
aliases:
- game
player:
build:
context: Player
dockerfile: Dockerfile
depends_on:
base-builder:
condition: service_completed_successfully
eventstore:
condition: service_healthy
redpanda:
condition: service_started
environment:
KAFKA_BOOTSTRAP_SERVERS: "redpanda:9092"
EVENTSTORE_CONNECTION_STRING: "kurrentdb://eventstore:2113?tls=false&tlsVerifyCert=false"
GAME_VIEW_PROJECTION_CONNECTION_STRING: "kurrentdb://eventstore:2113?tls=false&tlsVerifyCert=false"
PLAYER_VIEW_PROJECTION_CONNECTION_STRING: "kurrentdb://eventstore:2113?tls=false&tlsVerifyCert=false"
ports:
- "8082:8082"
networks:
burraco-net:
aliases:
- player
dealer:
build:
context: Dealer
dockerfile: Dockerfile
depends_on:
base-builder:
condition: service_completed_successfully
eventstore:
condition: service_healthy
redpanda:
condition: service_started
environment:
KAFKA_BOOTSTRAP_SERVERS: "redpanda:9092"
EVENT_STORE_DB_CONNECTION_STRING: "kurrentdb://eventstore:2113?tls=false&tlsVerifyCert=false"
# ports:
# - "8082:8082"
networks:
burraco-net:
aliases:
- dealer
# db:
# image: mariadb:latest
# command: --bind-address=0.0.0.0
# restart: always
# ports:
# - "3306:3306"
# networks:
# burraco-net:
# aliases:
# - db
# environment:
# MYSQL_ROOT_PASSWORD: root
# MYSQL_DATABASE: eventstore
# volumes:
# - ./init_db.sql:/docker-entrypoint-initdb.d/init_db.sql
eventstore:
image: docker.kurrent.io/kurrent-latest/kurrentdb:latest
environment:
- KURRENTDB_CLUSTER_SIZE=1
- KURRENTDB_RUN_PROJECTIONS=All
- KURRENTDB_START_STANDARD_PROJECTIONS=true
- KURRENTDB_NODE_PORT=2113
- KURRENTDB_INSECURE=true
- KURRENTDB_ENABLE_ATOM_PUB_OVER_HTTP=true
ports:
- "2113:2113"
volumes:
- kurrentdb-volume-data:/var/lib/kurrentdb
- kurrentdb-volume-logs:/var/log/kurrentdb
networks:
burraco-net:
aliases:
- eventstore
redpanda:
environment:
REDPANDA_VERSION: "v25.1.5"
command:
- redpanda
- start
- --kafka-addr internal://0.0.0.0:9092,external://0.0.0.0:19092
# Address the broker advertises to clients that connect to the Kafka API.
# Use the internal addresses to connect to the Redpanda brokers'
# from inside the same Docker network.
# Use the external addresses to connect to the Redpanda brokers'
# from outside the Docker network.
- --advertise-kafka-addr internal://redpanda:9092,external://localhost:19092
- --pandaproxy-addr internal://0.0.0.0:8082,external://0.0.0.0:18082
# Address the broker advertises to clients that connect to the HTTP Proxy.
- --advertise-pandaproxy-addr internal://redpanda:8082,external://localhost:18082
- --schema-registry-addr internal://0.0.0.0:8081,external://0.0.0.0:18081
# Redpanda brokers use the RPC API to communicate with each other internally.
- --rpc-addr redpanda:33145
- --advertise-rpc-addr redpanda:33145
# Mode dev-container uses well-known configuration properties for development in containers.
- --mode dev-container
# Phase 1 Optimization: Increase cores from 1 to 2 for better throughput
- --smp 2
# Phase 1 Optimization: Allocate 2GB memory (1GB per core)
- --memory 2G
- --default-log-level=info
image: docker.redpanda.com/redpandadata/redpanda:v25.1.5
volumes:
- redpanda-hd0:/var/lib/redpanda/data
networks:
- burraco-net
ports:
- 18081:18081
- 18082:18082
- 19092:19092
- 19644:9644
console:
image: docker.redpanda.com/redpandadata/console:v3.1.1
networks:
- burraco-net
entrypoint: /bin/sh
command: -c 'echo "$$CONSOLE_CONFIG_FILE" > /tmp/config.yml; /app/console'
environment:
REDPANDA_CONSOLE_VERSION: "v3.1.1"
CONFIG_FILEPATH: /tmp/config.yml
CONSOLE_CONFIG_FILE: |
kafka:
brokers: ["redpanda:9092"]
schemaRegistry:
enabled: true
urls: ["http://redpanda:8081"]
redpanda:
adminApi:
enabled: true
urls: ["http://redpanda:9644"]
ports:
- "8181:8080"
depends_on:
- redpanda
# Phase 3 Optimization: Initialize Kafka topics with 3 partitions for horizontal scaling
kafka-init:
image: docker.redpanda.com/redpandadata/redpanda:v25.1.5
networks:
- burraco-net
depends_on:
- redpanda
entrypoint: [ "/bin/sh" ]
command: -c "/scripts/init-kafka-topics.sh"
volumes:
- ./init-kafka-topics.sh:/scripts/init-kafka-topics.sh:ro
# projection:
# build: ./ReadModel
# depends_on:
# - db
# links:
# - db:mysql
# networks:
# burraco-project:
# aliases:
# - projection