-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathdocker-compose.yml
165 lines (164 loc) · 4.71 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
version: "3"
services:
claon_database:
container_name: claon_db
image: postgres:9.3
ports:
- "5432:5432"
environment:
POSTGRES_DB: "claon_db"
POSTGRES_USER: "colaon_user"
POSTGRES_PASSWORD: "colaon_password"
healthcheck:
test: [ "CMD", "pg_isready", "-U", "colaon_user", "-d", "claon_db" ]
interval: 5s
retries: 5
claon-auth-redis:
image: redis:6.0.5
container_name: claon_redis
labels:
- "name=redis"
- "mode=standalone"
ports:
- "6379:6379"
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 5s
timeout: 30s
retries: 50
zipkin:
image: openzipkin/zipkin
container_name: zipkin
ports:
- "9411:9411"
# Spring Service
discovery:
container_name: claon_discovery
build:
context: ./discovery
dockerfile: Dockerfile
ports:
- "8761:8761"
environment:
- SPRING_PROFILES_ACTIVE=local
- "eureka.client.serviceUrl.defaultZone=http://discovery:8761/eureka"
healthcheck:
test: "curl --fail --silent localhost:8761/actuator/health | grep UP || exit 1"
interval: 10s
retries: 5
timeout: 10s
monitor:
container_name: claon_monitor
build:
context: ./monitor
dockerfile: Dockerfile
ports:
- "8090:8090"
environment:
- SPRING_PROFILES_ACTIVE=local
- "eureka.client.serviceUrl.defaultZone=http://discovery:8761/eureka"
depends_on:
discovery:
condition: service_healthy
healthcheck:
test: "curl --fail --silent localhost:8090/actuator/health | grep UP || exit 1"
interval: 10s
retries: 5
timeout: 10s
gateway:
container_name: claon_gateway
build:
context: ./gateway
dockerfile: Dockerfile
ports:
- "8000:8000"
environment:
- SPRING_PROFILES_ACTIVE=local
- "eureka.client.serviceUrl.defaultZone=http://discovery:8761/eureka"
- "management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans"
depends_on:
discovery:
condition: service_healthy
monitor:
condition: service_healthy
auth:
container_name: claon_auth
build:
context: ./auth
dockerfile: Dockerfile
ports:
- "8080:8080"
environment:
- SPRING_PROFILES_ACTIVE=local
- "spring.datasource.url=jdbc:postgresql://claon_database:5432/claon_db"
- "spring.data.redis.host=claon-auth-redis"
- "eureka.client.serviceUrl.defaultZone=http://discovery:8761/eureka"
- "management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans"
depends_on:
claon_database:
condition: service_healthy
claon-auth-redis:
condition: service_healthy
discovery:
condition: service_healthy
monitor:
condition: service_healthy
user:
container_name: claon_user
build:
context: ./user
dockerfile: Dockerfile
ports:
- "8081:8081"
environment:
- SPRING_PROFILES_ACTIVE=local
- "spring.datasource.url=jdbc:postgresql://claon_database:5432/claon_db"
- "spring.cloud.openfeign.client.config.post-service.url=http://post:8083"
- "eureka.client.serviceUrl.defaultZone=http://discovery:8761/eureka"
- "management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans"
depends_on:
claon_database:
condition: service_healthy
discovery:
condition: service_healthy
monitor:
condition: service_healthy
center:
container_name: claon_center
build:
context: ./center
dockerfile: Dockerfile
ports:
- "8082:8082"
environment:
- SPRING_PROFILES_ACTIVE=local
- "spring.datasource.url=jdbc:postgresql://claon_database:5432/claon_db"
- "spring.cloud.openfeign.client.config.post-service.url=http://post:8083"
- "eureka.client.serviceUrl.defaultZone=http://discovery:8761/eureka"
- "management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans"
depends_on:
claon_database:
condition: service_healthy
discovery:
condition: service_healthy
monitor:
condition: service_healthy
post:
container_name: claon_post
build:
context: ./post
dockerfile: Dockerfile
ports:
- "8083:8083"
environment:
- SPRING_PROFILES_ACTIVE=local
- "spring.datasource.url=jdbc:postgresql://claon_database:5432/claon_db"
- "eureka.client.serviceUrl.defaultZone=http://discovery:8761/eureka"
- "management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans"
depends_on:
claon_database:
condition: service_healthy
discovery:
condition: service_healthy
monitor:
condition: service_healthy