-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdocker-compose.yml
107 lines (99 loc) · 2.68 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
version: "3.7"
services:
db:
image: mysql:8.0.33
environment:
MYSQL_ROOT_PASSWORD: root321
MYSQL_DATABASE: bookdb
MYSQL_USER: otel
MYSQL_PASSWORD: otel321
volumes:
- mysql_data:/var/lib/mysql
- ./initdb.sql:/docker-entrypoint-initdb.d/initdb.sql # MySQL 官方镜像支持在首次启动时自动执行 /docker-entrypoint-initdb.d/ 目录下的 SQL 文件
ports:
- "3306:3306"
jaeger:
image: jaegertracing/all-in-one:1.47
ports:
- "16686:16686" # Jaeger UI
- "14268" # Jaeger Thrift HTTP
- "14250" # Jaeger Thrift Compact
otel-collector:
image: otel/opentelemetry-collector-contrib:0.81.0
restart: always
command: ["--config=/conf/otel-collector-config.yaml"]
volumes:
- ./otel-collector-config.yaml:/conf/otel-collector-config.yaml
ports:
- "1888:1888" # pprof extension
- "8888:8888" # Prometheus metrics exposed by the collector
- "8889:8889" # Prometheus exporter metrics
- "13133:13133" # health_check extension
- "4317:4317" # OTLP gRPC receiver
- "4318:4318" # OTLP http receiver
- "55679:55679" # zpages extension
- "14278:14278" # Jaeger Thrift HTTP 接收器地址
depends_on:
- jaeger
userservice:
build:
context: ./src/userservice
dockerfile: Dockerfile
environment:
- DATABASE_URI=otel:otel321@tcp(db:3306)/bookdb?parseTime=true
depends_on:
- db
- otel-collector
catalogservice:
build:
context: ./src/catalogservice
dockerfile: Dockerfile
environment:
- DB_HOST=db
- USER_SERVICE_URL=http://userservice:8080
depends_on:
- db
- userservice
- otel-collector
orderservice:
build:
context: ./src/orderservice
dockerfile: Dockerfile
environment:
- DB_HOST=db
- DB_PORT=3306
- USER_SERVICE_URL=http://userservice:8080
- CATALOG_SERVICE_URL=http://catalogservice:8082
depends_on:
- db
- userservice
- catalogservice
- otel-collector
payservice:
build:
context: ./src/paymentservice
dockerfile: Dockerfile
environment:
- SQLALCHEMY_DATABASE_URI=mysql+pymysql://otel:otel321@db/bookdb
- USER_SERVICE_URL=http://userservice:8080
- ORDER_SERVICE_URL=http://orderservice:8081
depends_on:
- db
- userservice
- catalogservice
- orderservice
- otel-collector
frontend:
build:
context: ./src/frontend
dockerfile: Dockerfile
ports:
- "80:80"
depends_on:
- userservice
- catalogservice
- orderservice
- payservice
- otel-collector
volumes:
mysql_data: