forked from zhoushuguang/lebron
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-env.yml
132 lines (123 loc) · 3.98 KB
/
docker-compose-env.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
version: '3.5'
# 网络配置
networks:
backend:
driver: bridge # 设置网络模式
# 服务容器配置
services:
mysql:
image: mysql:5.7
container_name: mysql
command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
environment:
- TZ=${TZ}
- MYSQL_PASSWORD=123456 # 设置 Mysql 用户密码
- MYSQL_ROOT_PASSWORD=123456 # 设置 Mysql root 用户密码
privileged: true
volumes:
- ${DATA_PATH_HOST}/mysql:/var/lib/mysql # 引用 .env 配置中 DATA_PATH_HOST 变量,将宿主机上存放 Mysql 数据的目录挂载到容器中 /var/lib/mysql 目录
ports:
- "3306:3306" # 设置容器3306端口映射指定宿主机端口
networks:
- backend
restart: always
redis:
image: redis:5.0.5
container_name: redis
environment:
- TZ=${TZ}
privileged: true
volumes:
- ${DATA_PATH_HOST}/redis:/data # 引用 .env 配置中 DATA_PATH_HOST 变量,将宿主机上存放 Redis 数据的目录挂载到容器中 /data 目录
ports:
- "6379:6379" # 设置容器6379端口映射指定宿主机端口
networks:
- backend
restart: always
rabbitmq:
image: rabbitmq:3.7.15-management
container_name: rabbitmq
volumes:
- ${DATA_PATH_HOST}/rabbitmq/data:/var/lib/rabbitmq #数据文件挂载
- ${DATA_PATH_HOST}/rabbitmq/log:/var/log/rabbitmq #日志文件挂载
ports:
- 5672:5672
- 15672:15672
etcd: # 自定义容器名称
image: bitnami/etcd
container_name: etcd
environment:
- TZ=${TZ}
- ALLOW_NONE_AUTHENTICATION=yes
- ETCD_ADVERTISE_CLIENT_URLS=http://etcd:2379
#- ETCD_ADVERTISE_CLIENT_URLS=http://127.0.0.1:2379
ports: # 设置端口映射 Etcd 服务映射宿主机端口号,可在宿主机127.0.0.1:2379访问
- "2379:2379"
networks:
- backend
restart: always
etcd-manage:
image: evildecay/etcdkeeper
container_name: etcd-manage
environment:
- TZ=${TZ}
ports:
- "7000:8080" # 设置容器8080端口映射指定宿主机端口,用于宿主机访问可视化web
depends_on: # 依赖容器
- etcd # 在 etcd 服务容器启动后启动
networks:
- backend
restart: always
prometheus:
image: prom/prometheus:v2.28.1
# 下面这个备用
#image: bitnami/prometheus
container_name: prometheus
environment:
- TZ=${TZ}
privileged: true
volumes:
- ./prometheus/prometheus.yml:/opt/bitnami/prometheus/conf/prometheus.yml # 将 prometheus 配置文件挂载到容器里
ports:
# Prometheus 服务映射宿主机端口号,可在宿主机127.0.0.1:3000访问
- "3000:9090" # 设置容器9090端口映射指定宿主机端口,用于宿主机访问可视化web
networks:
- backend
restart: always
grafana:
image: grafana/grafana:8.0.6
container_name: grafana
environment:
- TZ=${TZ}
ports:
- "4000:3000" # 设置容器3000端口映射指定宿主机端口,127.0.0.1:4000访问
networks:
- backend
restart: always
jaeger:
image: jaeger/all-in-one:latest
container_name: jaeger
environment:
- TZ=${TZ}
ports:
- "5000:16686" # 设置容器16686端口映射指定宿主机端口,可在宿主机127.0.0.1:5000访问
networks:
- backend
restart: always
#用到的时候 再打开
# dtm:
# image: yedf/dtm
# environment:
# - TZ=${TZ}
# entrypoint:
# - "/app/dtm/dtm"
# - "-c=/app/dtm/configs/etc.yaml"
# privileged: true
# volumes:
# - ./dtm/etc.yml:/app/dtm/configs/etc.yaml # 将 dtm 配置文件挂载到容器里
# ports:
# - "36789:36789" # DTM HTTP 协议端口号
# - "36790:36790" # DTM gRPC 协议端口号
# networks:
# - backend
# restart: always