-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathdocker-compose.yml
138 lines (130 loc) · 3.31 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
version: '3.8'
services:
mysql:
image: mysql:8.0
container_name: mysql_shopdevgo
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: shopdevgo
ports:
- '3308:3306'
volumes:
- mysql_data:/var/lib/mysql
networks:
- shopdev_network
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "127.0.0.1"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7.4
container_name: redis_shopdevgo
command: ['redis-server', '--port', '6381']
ports:
- '6381:6379'
volumes:
- redis_data:/data
restart: unless-stopped # Auto-restart Redis on failure
networks:
- shopdev_network
healthcheck:
test: ["CMD", "redis-cli", "-p", "6381", "ping"]
interval: 10s
timeout: 5s
retries: 3
backend_api:
build: .
container_name: backend_shopdevgo
ports:
- '8002:8002'
volumes:
- .:/app # Mount all source code from host into container
depends_on:
- mysql
- redis
networks:
- shopdev_network
stdin_open: true
tty: true
zookeeper:
platform: linux/amd64
image: confluentinc/cp-zookeeper:latest
container_name: zookeeper
restart: unless-stopped
ports:
- '32181:32181'
- '2888:2888'
- '3888:3888'
environment:
ZOOKEEPER_SERVER_ID: 1
ZOOKEEPER_CLIENT_PORT: 32181
ZOOKEEPER_TICK_TIME: 2000
ZOOKEEPER_INIT_LIMIT: 5
ZOOKEEPER_SYNC_LIMIT: 2
ZOOKEEPER_SERVERS: zookeeper:2888:3888
healthcheck:
test: echo stat | nc localhost 32181
interval: 10s
timeout: 10s
retries: 3
logging:
driver: 'json-file'
options:
max-size: '1m'
networks:
- shopdev_network
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- '8080:8080'
depends_on:
- broker
environment:
KAFKA_CLUSTERS_0_NAME: broker
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: broker:29091
KAFKA_CLUSTERS_0_METRICS_PORT: 19101
KAFKA_CLUSTERS_0_JMX_PORT: 19101
DYNAMIC_CONFIG_ENABLED: 'true'
logging:
driver: 'json-file'
options:
max-size: '1m'
networks:
- shopdev_network
broker:
platform: linux/amd64
image: confluentinc/cp-kafka:7.4.0
container_name: broker
restart: unless-stopped
ports:
- '9091:9091'
- '19101:19101'
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:32181
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_ADVERTISED_LISTENERS: INTERNAL://broker:29091,EXTERNAL://localhost:9091
KAFKA_DEFAULT_REPLICATION_FACTOR: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_NUM_PARTITIONS: 1
KAFKA_JMX_PORT: 19101
KAFKA_JMX_HOSTNAME: localhost
KAFKA_JMX_USER: myuser
KAFKA_JMX_PASSWORD: mypassword
volumes:
- broker_data:/var/lib/kafka/data
- ./jmxremote.password:/user/lib/jvm/zulu11-ca/conf/management/jmxremote.password
- ./jmxremote.access:/user/lib/jvm/zulu11-ca/conf/management/jmxremote.access
networks:
- shopdev_network
volumes:
mysql_data:
redis_data:
broker_data:
networks:
shopdev_network: