forked from go-eagle/eagle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
169 lines (157 loc) · 3.87 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
# yaml 配置
# 官方文档:https://docs.docker.com/compose/compose-file/
version: "3.7"
services:
app:
container_name: app_container
build: .
restart: on-failure
depends_on:
- db
- redis
links:
- db
- redis
ports:
- "8080:8080"
networks:
- eagle
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/health"] # 用于健康检查的指令
interval: 1m30s # 间隔时间
timeout: 10s # 超时时间
retries: 3 # 重试次数
start_period: 40s # 启动多久后开始检查
db:
container_name: mysql_container
image: mysql:5.7.33
ports:
- "3306:3306"
expose:
- "3306"
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_DATABASE: eagle
MYSQL_USER: root
MYSQL_PASSWORD: root
TZ: Asia/Shanghai
# 解决外部无法访问 for mysql8
command: [
'--character-set-server=utf8',
'--collation-server=utf8_unicode_ci',
'--default-authentication-plugin=mysql_native_password'
]
healthcheck:
test: [ "CMD", "mysqladmin", "ping", "-h", "localhost" ] # 用于健康检查的指令
timeout: 20s # 超时时间
retries: 10 # 重试次数
start_period: 40s # 启动多久后开始检查
stdin_open: true
tty: true
# 修复问题 mbind: Operation not permitted
security_opt:
- seccomp:unconfined
volumes:
- mysql_data:/var/lib/mysql
- ./deploy/docker/mysql/my.cnf:/etc/mysql/my.cnf
- ./deploy/docker/mysql/my.cnf:/etc/mysql/mysql.conf.d/mysqld.cnf
- ./deploy/docker/mysql/:/docker-entrypoint-initdb.d/
networks:
- eagle
# web 数据库管理工具,tips: host使用 db:3306
adminer:
container_name: adminer_container
image: adminer
restart: always
depends_on:
- db
ports:
- 8036:8036
redis:
container_name: redis_container
image: redis:6.0.9-alpine
ports:
- "6379:6379"
networks:
- eagle
volumes:
- redis_data:/var/lib/redis
nginx:
container_name: nginx_container
image: nginx:1.17.10-alpine
ports:
- 80:80
depends_on:
- app
volumes:
- ./config/nginx_api.conf:/etc/nginx/conf.d/eagle.conf
command: nginx -g 'daemon off';
prometheus:
container_name: prometheus_container
image: prom/prometheus
restart: always
volumes:
- ./deploy/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:Z
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--storage.tsdb.path=/prometheus'
- '--storage.tsdb.retention=20d'
- '--web.console.libraries=/usr/share/prometheus/console_libraries'
- '--web.console.templates=/usr/share/prometheus/consoles'
ports:
- '9090:9090'
networks:
- eagle
node_exporter:
container_name: node_exporter_container
restart: always
image: prom/node-exporter
ports:
- '9101:9100'
networks:
- eagle
grafana:
container_name: grafana_container
restart: always
image: grafana/grafana
ports:
- '3000:3000'
networks:
- eagle
jaeger:
container_name: jaeger_container
image: jaegertracing/all-in-one:1.21
environment:
- COLLECTOR_ZIPKIN_HTTP_PORT=9411
ports:
- 5775:5775/udp
- 6831:6831/udp
- 6832:6832/udp
- 5778:5778
- 16686:16686
- 14268:14268
- 14250:14250
- 9411:9411
networks:
- eagle
mongodb:
image: mongo:latest
container_name: mongodb_container
restart: always
environment:
MONGO_INITDB_ROOT_USERNAME: admin
MONGO_INITDB_ROOT_PASSWORD: admin
MONGODB_DATABASE: eagle
ports:
- 27017:27017
volumes:
- mongodb_data:/data/db
networks:
- eagle
networks:
eagle:
driver: "bridge"
volumes:
mysql_data:
redis_data:
mongodb_data: