-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
72 lines (71 loc) · 2.17 KB
/
docker-compose.yaml
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
# docker compose 一般应用在单体单机应用中
version: "3.8"
# services :我的这个docker compose由几个服务组成
services:
mysql8:
# 指定镜像版本
image: mysql:8.0
# 启动命令
command: --default-authentication-plugin=mysql_native_password
# 重启策略
restart: always
environment:
MYSQL_ROOT_PASSWORD: root
# volumes 挂载文件 用来初始化数据库
volumes:
- ./script/mysql/:/docker-entrypoint-initdb.d/
# 指定端口映射关系
ports:
# -外部访问用13316端口
- "13316:3306"
prometheus:
image: prom/prometheus:v2.47.2
volumes:
# - 将本地的 prometheus 文件映射到容器内的配置文件
- ./prometheus.yaml:/etc/prometheus/prometheus.yml
ports:
# - 访问数据的端口
- 9090:9090
command:
- "--web.enable-remote-write-receiver"
- "--config.file=/etc/prometheus/prometheus.yml"
redis:
image: 'bitnami/redis:latest'
restart: always
environment:
- ALLOW_EMPTY_PASSWORD=yes
ports:
- '6379:6379'
mongo:
image: 'bitnami/mongodb:latest'
restart: always
environment:
- MONGODB_ROOT_PASSWORD=root
- MONGODB_USERNAME=root
ports:
- '27017:27017'
etcd:
image: 'bitnami/etcd:latest'
restart: always
environment:
#
- ALLOW_NONE_AUTHENTICATION=yes
ports:
- '12379:2379'
kafka:
image: 'bitnami/kafka:latest'
ports:
- '9092:9092'
- '9094:9094'
environment:
- KAFKA_CFG_NODE_ID=0
# - 三个分区
- KAFKA_CREATE_TOPICS=webook_binlog:3:1
# - 允许自动创建 topic,线上不要开启
- KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE=true
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_LISTENERS=PLAINTEXT://0.0.0.0:9092,CONTROLLER://:9093,EXTERNAL://0.0.0.0:9094
- KAFKA_CFG_ADVERTISED_LISTENERS=PLAINTEXT://kafka:9092,EXTERNAL://localhost:9094
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,EXTERNAL:PLAINTEXT,PLAINTEXT:PLAINTEXT
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:9093
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER