-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathdocker-compose.yml
183 lines (180 loc) · 6.42 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
services:
etcd-apisix:
image: pachyderm/etcd:v3.5.2
container_name: etcd-apisix
# 容器使用宿主机的网络
network_mode: "host"
detach: true
postgres:
image: postgres
container_name: postgres
restart: always
environment:
POSTGRES_PASSWORD: "root123456"
volumes:
- /var/lib/postgresql/data:/var/lib/postgresql/data
- /var/log/postgresql:/var/lib/postgresql/log
ports:
- 5432:5432
networks:
- pub-network
pgadmin:
image: dpage/pgadmin4
container_name: pgAdmin
restart: always
ports:
- 5050:80
environment:
PGADMIN_DEFAULT_EMAIL: [email protected]
PGADMIN_DEFAULT_PASSWORD: root123456
networks:
- pub-network
redis:
image: redis:latest
container_name: redis
restart: always
ports:
- 6379:6379
volumes:
- /opt/redis/data:/data
- /opt/redis/conf/redis.conf:/etc/redis/redis.conf
command: redis-server /etc/redis/redis.conf
networks:
- pub-network
nacos:
image: qingpan/rnacos:stable
container_name: nacos
restart: always
ports:
- 8848:8848
- 9848:9448
- 10848:10848
volumes:
- /opt/nacos/data:/io:rw
environment:
- RNACOS_INIT_ADMIN_USERNAME=admin
- RNACOS_INIT_ADMIN_PASSWORD=admin123456
- RNACOS_HTTP_PORT=8848
minio:
image: minio/minio
container_name: minio
restart: always
environment:
MINIO_ACCESS_KEY: admin
MINIO_SECRET_KEY: admin123456
ports:
- 9000:9000
- 9090:9090
volumes:
- /opt/minio/config:/root/.minio
- /opt/minio/data:/data
command: server /data --console-address ":9090"
networks:
- pub-network
# es:
# image: elasticsearch:8.15.2
# container_name: es
# restart: always
# ports:
# # 9200:对外暴露的端口
# - 9200:9200
# # 9300:节点间通信端口
# - 9300:9300
# environment:
# # 禁用密码登录
# xpack.security.enabled: 'false'
# # 单节点运行
# discovery.type: single-node
# # 允许跨域
# http.cors.enabled: 'true'
# # 允许所有访问
# http.cors.allow-origin: '*'
# # 堆内存大小
# ES_JAVA_OPTS: '-Xms512m -Xmx512m'
# volumes:
# # 数据挂载
# - /opt/es/data:/usr/share/elasticsearch/data
# # 插件挂载
# - /opt/es/plugins:/usr/share/elasticsearch/plugins
# # 日志挂载
# - /opt/es/logs:/usr/share/elasticsearch/logs
# # 允许root用户运行
# privileged: true
# networks:
# - pub-network
# kibana:
# image: kibana:8.15.2
# container_name: kibana
# restart: always
# ports:
# - 5601:5601
# environment:
# CSP_STRICT: 'false'
# I18N_LOCALE: zh-CN
# networks:
# - pub-network
broker:
image: apache/kafka:latest
container_name: broker
ports:
- "9092:9092"
networks:
- pub-network
restart: always
environment:
# 设置 Kafka 节点的 ID 为 1。在 Kafka 集群中,每个节点都有一个唯一的 ID
KAFKA_NODE_ID: 1
# 指定这个 Kafka 节点的角色为 broker(消息代理)和 controller(控制器)。Controller 负责管理集群中的分区分配等任务
KAFKA_PROCESS_ROLES: broker,controller
# 设置 Kafka 的监听器。这里配置了两种监听器,一种是普通的 PLAINTEXT 监听器在 9092 端口,用于接收客户端的连接;另一种是 CONTROLLER 监听器在 9093 端口,用于控制器的通信
KAFKA_LISTENERS: PLAINTEXT://:9092,CONTROLLER://:9093
# 设置对外公布的监听器地址,这里表示客户端可以通过 “[localhost:9092](https://localhost:9092/)” 连接到这个 Kafka 节点,如果不配置外部无法连接到Kafka
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://:9092
# 指定控制器使用的监听器名称为 “CONTROLLER”
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
# 定义监听器的安全协议映射。这里表示 CONTROLLER 监听器使用 PLAINTEXT 协议,普通的 PLAINTEXT 监听器也使用 PLAINTEXT 协议
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT
# 设置控制器的法定人数投票者,这里表示只有一个节点(ID 为 1)在 “[broker:9093](https://broker:9093/)” 作为投票者,通过容器名解析ip
KAFKA_CONTROLLER_QUORUM_VOTERS: 1@broker:9093
# 设置 Kafka 的Topic偏移量(用于记录消费者的消费位置)的复制因子为 1,即只有一个副本,最小1,最大不能超过节点数
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
# 设置 Kafka 的事务状态日志的复制因子为 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
# 设置事务状态日志的最小同步副本数为 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
# 设置消费者组的初始重新平衡延迟为 0 毫秒
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
# 设置默认的主题分区数量为 3
KAFKA_NUM_PARTITIONS: 3
debezium:
image: debezium/connect:2.7.3.Final
container_name: debezium
restart: always
volumes:
- /opt/debezium/kafak/connect:/kafka/connect
environment:
# 指定 Kafka 连接器的配置
BOOTSTRAP_SERVERS: broker:9092
# 指定消费者组id
GROUP_ID: 1
# 存储Debezium的配置信息到Kafka的Topic名,用于重启时加载配置
CONFIG_STORAGE_TOPIC: connect_configs
# 存储消费者偏移量信息到Kafka的Topic名,用于记录消费者进度
OFFSET_STORAGE_TOPIC: connect_offsets
STATUS_STORAGE_TOPIC: connect_statuses
# 指定键值转换器,使用`Avro`来格式化、序列化键值数据
# KEY_CONVERTER: io.confluent.connect.avro.AvroConverter
# VALUE_CONVERTER: io.confluent.connect.avro.AvroConverter
# 指定`Avro`键值转换器的模式注册表地址,用于存储和管理`Avro`模式
# CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
# CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
depends_on:
- broker
- postgres
ports:
- 8083:8083
networks:
- pub-network
networks:
pub-network:
name: pub-network