-
Notifications
You must be signed in to change notification settings - Fork 6
/
docker-compose.yml
146 lines (135 loc) · 3.66 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
services:
db:
image: postgres:15
volumes:
- postgres_data:/var/lib/postgresql/data/
healthcheck:
test: [ "CMD", "pg_isready", "-U", "grandchat", "-d", "grandchat" ]
interval: 1s
timeout: 5s
retries: 10
environment:
- POSTGRES_USER=grandchat
- POSTGRES_PASSWORD=grandchat
- POSTGRES_DB=grandchat
expose:
- 5432
ports:
- 5432:5432
command: ["postgres", "-c", "wal_level=logical", "-c", "wal_writer_delay=10ms"]
backend:
build: ./backend
restart: unless-stopped
volumes:
- ./backend:/usr/src/app
expose:
- 8000
depends_on:
db:
condition: service_healthy
migrations:
build: ./backend
restart: on-failure
command: >
python manage.py migrate
depends_on:
db:
condition: service_healthy
frontend:
stdin_open: true
build: ./frontend
volumes:
- ./frontend:/usr/src/app
- /usr/src/app/node_modules
expose:
- 5173
environment:
- NODE_ENV=development
depends_on:
- backend
centrifugo:
image: centrifugo/centrifugo:v5.2.0
restart: unless-stopped
volumes:
- ./centrifugo/config.json:/centrifugo/config.json
command: centrifugo -c config.json
expose:
- 8000
depends_on:
db:
condition: service_healthy
kafka:
condition: service_healthy
zookeeper:
image: confluentinc/cp-zookeeper:7.4.3
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
kafka:
image: confluentinc/cp-kafka:7.4.3
depends_on:
- zookeeper
ports:
- "29092:29092"
expose:
- 9092
healthcheck:
test: ["CMD", "kafka-topics", "--list", "--bootstrap-server", "localhost:9092"]
interval: 2s
timeout: 5s
retries: 10
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_MAX_REQUEST_SIZE: "10485760"
KAFKA_MESSAGE_MAX_BYTES: "10485760"
KAFKA_MAX_PARTITION_FETCH_BYTES: "10485760"
connect:
image: debezium/connect:2.5
depends_on:
db:
condition: service_healthy
kafka:
condition: service_healthy
ports:
- "8083:8083"
environment:
BOOTSTRAP_SERVERS: kafka:9092
GROUP_ID: 1
CONFIG_STORAGE_TOPIC: connect_configs
OFFSET_STORAGE_TOPIC: connect_offsets
STATUS_STORAGE_TOPIC: connect_statuses
connect-config-loader:
image: appropriate/curl:latest
depends_on:
- connect
volumes:
- ./debezium/debezium-config.json:/debezium-config.json
command: >
/bin/sh -c "
echo 'Waiting for Kafka Connect to start...';
while ! curl -f http://connect:8083/connectors; do sleep 1; done;
echo 'Kafka Connect is up, posting configuration';
curl -X DELETE -H 'Content-Type: application/json' http://connect:8083/connectors/grandchat-chat-connector;
curl -X POST -H 'Content-Type: application/json' -v --data @/debezium-config.json http://connect:8083/connectors;
echo 'Configuration posted';
"
nginx:
image: nginx:1.25
restart: unless-stopped
volumes:
- ./nginx:/etc/nginx/
ports:
- 9000:80
depends_on:
- backend
- frontend
- centrifugo
volumes:
postgres_data: