-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
246 lines (232 loc) · 6.74 KB
/
docker-compose.yml
File metadata and controls
246 lines (232 loc) · 6.74 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
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
services:
web:
build:
context: .
dockerfile: apps/web/Dockerfile
restart: unless-stopped
ports:
- '80:80'
environment:
- VITE_API_URL=/api/trpc
api:
build:
dockerfile: Dockerfile
args:
- APP_NAME=api
restart: unless-stopped
environment:
- DATABASE_URL=postgresql://api_user:${API_DB_PASSWORD}@postgres:5432/api_service
- ENCRYPTION_KEY=${API_ENCRYPTION_KEY}
- JWT_SECRET=${API_JWT_SECRET}
- DISCORD_REDIRECT_URI=${DISCORD_REDIRECT_URI}
- DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID}
- DISCORD_CLIENT_SECRET=${DISCORD_CLIENT_SECRET}
- REDIS_HOST=redis
- PORT=3000
- CONFIG_SERVICE_URL=http://config:3000/trpc
- LEVELING_SERVICE_URL=http://leveling:3000/trpc
- DISCORD_REST_SERVICE_URL=http://discord-rest:3000/trpc
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
config:
condition: service_healthy
leveling:
condition: service_healthy
discord-rest:
condition: service_healthy
config:
build:
dockerfile: Dockerfile
args:
- APP_NAME=config
restart: unless-stopped
environment:
- DATABASE_URL=postgresql://config_user:${CONFIG_DB_PASSWORD}@postgres:5432/config_service?schema=public
- REDIS_HOST=redis
- KAFKA_BROKERS=kafka:9092
- PORT=3000
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
discord-ws:
build:
dockerfile: Dockerfile
args:
- APP_NAME=discord-ws
restart: unless-stopped
environment:
- REDIS_HOST=redis
- KAFKA_BROKERS=kafka:9092
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}
- CONFIG_SERVICE_URL=http://config:3000/trpc
- DISCORD_REST_SERVICE_URL=http://discord-rest:3000/trpc
depends_on:
redis:
condition: service_healthy
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
config:
condition: service_healthy
discord-rest:
build:
dockerfile: Dockerfile
args:
- APP_NAME=discord-rest
restart: unless-stopped
environment:
- REDIS_HOST=redis
- KAFKA_BROKERS=kafka:9092
- DISCORD_BOT_TOKEN=${DISCORD_BOT_TOKEN}
- DISCORD_CLIENT_ID=${DISCORD_CLIENT_ID}
- PORT=3000
depends_on:
redis:
condition: service_healthy
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
leveling:
build:
dockerfile: Dockerfile
args:
- APP_NAME=leveling
restart: unless-stopped
environment:
- DATABASE_URL=postgresql://leveling_user:${LEVELING_DB_PASSWORD}@postgres:5432/leveling_service
- REDIS_HOST=redis
- KAFKA_BROKERS=kafka:9092
- CONFIG_SERVICE_URL=http://config:3000/trpc
- DISCORD_REST_SERVICE_URL=http://discord-rest:3000/trpc
- PORT=3000
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
kafka:
condition: service_healthy
config:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
ticketing:
build:
dockerfile: Dockerfile
args:
- APP_NAME=ticketing
restart: unless-stopped
environment:
- DATABASE_URL=postgresql://ticketing_user:${TICKETING_DB_PASSWORD}@postgres:5432/ticketing_service
- REDIS_HOST=redis
- KAFKA_BROKERS=kafka:9092
- CONFIG_SERVICE_URL=http://config:3000/trpc
- DISCORD_REST_SERVICE_URL=http://discord-rest:3000/trpc
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
kafka:
condition: service_healthy
config:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
welcoming:
build:
dockerfile: Dockerfile
args:
- APP_NAME=welcoming
restart: unless-stopped
environment:
- REDIS_HOST=redis
- KAFKA_BROKERS=kafka:9092
- CONFIG_SERVICE_URL=http://config:3000/trpc
- DISCORD_REST_SERVICE_URL=http://discord-rest:3000/trpc
depends_on:
redis:
condition: service_healthy
kafka:
condition: service_healthy
kafka-init:
condition: service_completed_successfully
config:
condition: service_healthy
postgres:
image: postgres:18
restart: unless-stopped
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: ${POSTGRES_ADMIN_PASSWORD}
POSTGRES_MULTIPLE_DATABASES: api_service:api_user:${API_DB_PASSWORD},config_service:config_user:${CONFIG_DB_PASSWORD},leveling_service:leveling_user:${LEVELING_DB_PASSWORD},ticketing_service:ticketing_user:${TICKETING_DB_PASSWORD}
volumes:
- pgdata:/var/lib/postgresql
- ./scripts/init-db-users.sh:/docker-entrypoint-initdb.d/init-db-users.sh
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U admin']
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:8
restart: unless-stopped
volumes:
- redisdata:/data
healthcheck:
test: ['CMD', 'redis-cli', 'ping']
interval: 5s
timeout: 3s
retries: 5
kafka:
image: apache/kafka:4.1.1
restart: unless-stopped
environment:
KAFKA_NODE_ID: 1
KAFKA_PROCESS_ROLES: broker,controller
KAFKA_LISTENERS: PLAINTEXT://0.0.0.0:9092,CONTROLLER://0.0.0.0:9093
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@kafka:9093
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_NUM_PARTITIONS: 3
CLUSTER_ID: cipibot-kafka-cluster
healthcheck:
test: ['CMD-SHELL', 'nc -z localhost 9092 || exit 1']
interval: 5s
timeout: 10s
retries: 15
start_period: 40s
kafka-init:
image: apache/kafka:4.1.1
restart: on-failure
depends_on:
kafka:
condition: service_healthy
volumes:
- ./scripts/create-topics.sh:/usr/bin/create-topics.sh
entrypoint: ['/bin/bash', '/usr/bin/create-topics.sh']
dozzle:
image: amir20/dozzle:latest
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- 8888:8080
volumes:
pgdata:
redisdata: