-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathcompose.yaml
161 lines (161 loc) · 4.77 KB
/
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
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
services:
mysql:
image: mysql:8.0
environment:
TZ: Asia/Shanghai
MYSQL_ALLOW_EMPTY_PASSWORD: "yes"
ports:
- 3316:3306
volumes:
- ~/data/spring-cloud-in-practice/mysql/data:/var/lib/mysql
- ./db/migration/mysql:/docker-entrypoint-initdb.d:ro
healthcheck:
test: ["CMD", "mysqladmin" ,"ping", "-u", "root"]
start_period: 30s
interval: 10s
timeout: 5s
retries: 10
cap_add:
- CAP_SYS_NICE
redis:
image: redis:6.2
environment:
TZ: Asia/Shanghai
ports:
- 6389:6379
volumes:
- ~/data/spring-cloud-in-practice/redis/data:/data
healthcheck:
test: ["CMD", "redis-cli" ,"ping"]
start_period: 10s
interval: 5s
timeout: 5s
retries: 10
consul:
image: consul:1.10
command: agent -dev -client 0.0.0.0 -log-level info
environment:
TZ: Asia/Shanghai
ports:
- 8510:8500
volumes:
- ~/data/spring-cloud-in-practice/consul/data:/consul/data
gateway:
image: spring-cloud-in-practice-gateway
build: ./gateway
environment:
TZ: Asia/Shanghai
SCIP_DEBUG: "false"
SCIP_LOGGING_FILE_PATH: /data/log
SCIP_LOGGING_LEVEL_REQUEST: INFO
SCIP_SPRING_REDIS_HOST: redis
SCIP_SPRING_REDIS_PORT: 6379
SCIP_SPRING_REDIS_PASSWORD:
SCIP_SPRING_CLOUD_CONSUL_HOST: consul
SCIP_SPRING_CLOUD_CONSUL_PORT: 8500
SCIP_SERVICE_FILE_BASE_URL: http://localhost:8080/files
ports:
- 8090:8080
volumes:
- ~/data/spring-cloud-in-practice/gateway/data:/data
- ~/data/spring-cloud-in-practice/gateway/config:/app/config:ro
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
consul:
condition: service_started
user:
image: spring-cloud-in-practice-user
build: ./user
environment:
TZ: Asia/Shanghai
SCIP_DEBUG: "false"
SCIP_LOGGING_FILE_PATH: /data/log
SCIP_LOGGING_LEVEL_REQUEST: INFO
SCIP_SPRING_DATASOURCE_URL: jdbc:mysql://mysql/scip_user
SCIP_SPRING_DATASOURCE_USERNAME: scip_user
SCIP_SPRING_DATASOURCE_PASSWORD: 123456
SCIP_SPRING_CLOUD_CONSUL_HOST: consul
SCIP_SPRING_CLOUD_CONSUL_PORT: 8500
volumes:
- ~/data/spring-cloud-in-practice/user/data:/data
- ~/data/spring-cloud-in-practice/user/config:/app/config:ro
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
consul:
condition: service_started
post:
image: spring-cloud-in-practice-post
build: ./post
environment:
TZ: Asia/Shanghai
SCIP_DEBUG: "false"
SCIP_LOGGING_FILE_PATH: /data/log
SCIP_LOGGING_LEVEL_REQUEST: INFO
SCIP_SPRING_DATASOURCE_URL: jdbc:mysql://mysql/scip_post
SCIP_SPRING_DATASOURCE_USERNAME: scip_post
SCIP_SPRING_DATASOURCE_PASSWORD: 123456
SCIP_SPRING_CLOUD_CONSUL_HOST: consul
SCIP_SPRING_CLOUD_CONSUL_PORT: 8500
volumes:
- ~/data/spring-cloud-in-practice/post/data:/data
- ~/data/spring-cloud-in-practice/post/config:/app/config:ro
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
consul:
condition: service_started
file:
image: spring-cloud-in-practice-file
build: ./file
environment:
TZ: Asia/Shanghai
SCIP_DEBUG: "false"
SCIP_LOGGING_FILE_PATH: /data/log
SCIP_LOGGING_LEVEL_REQUEST: INFO
SCIP_SPRING_DATASOURCE_URL: jdbc:mysql://mysql/scip_file
SCIP_SPRING_DATASOURCE_USERNAME: scip_file
SCIP_SPRING_DATASOURCE_PASSWORD: 123456
SCIP_SPRING_CLOUD_CONSUL_HOST: consul
SCIP_SPRING_CLOUD_CONSUL_PORT: 8500
SCIP_FILE_UPLOAD_DIR: /data/upload
volumes:
- ~/data/spring-cloud-in-practice/file/data:/data
- ~/data/spring-cloud-in-practice/file/config:/app/config:ro
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
consul:
condition: service_started
stat:
image: spring-cloud-in-practice-stat
build: ./stat
environment:
TZ: Asia/Shanghai
SCIP_DEBUG: "false"
SCIP_LOGGING_FILE_PATH: /data/log
SCIP_LOGGING_LEVEL_REQUEST: INFO
SCIP_SPRING_DATASOURCE_URL: jdbc:mysql://mysql/scip_stat
SCIP_SPRING_DATASOURCE_USERNAME: scip_stat
SCIP_SPRING_DATASOURCE_PASSWORD: 123456
SCIP_SPRING_CLOUD_CONSUL_HOST: consul
SCIP_SPRING_CLOUD_CONSUL_PORT: 8500
volumes:
- ~/data/spring-cloud-in-practice/stat/data:/data
- ~/data/spring-cloud-in-practice/stat/config:/app/config:ro
depends_on:
mysql:
condition: service_healthy
redis:
condition: service_healthy
consul:
condition: service_started