-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
193 lines (181 loc) · 4.96 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
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
version: '3.8'
networks:
container-nw:
services:
database:
image: 'postgres:13'
environment:
POSTGRES_USER: pgadmin
POSTGRES_PASSWORD: 'pgadmin#123'
POSTGRES_DB: testdb
volumes:
- '~/data/opencensus-pgres-13:/var/lib/postgresql/data'
- './resources/docker/postgres-init.sh:/docker-entrypoint-initdb.d/postgres-init.sh'
ports:
- 5432:5432
networks:
- container-nw
jaeger:
image: 'jaegertracing/all-in-one:1.19'
networks:
- container-nw
ports:
- 6831:6831/udp
- 16686:16686
- 14268:14268
zipkin:
image: openzipkin/zipkin
networks:
- container-nw
ports:
- 9411:9411
open-census-agent:
image: 'omnition/opencensus-agent:0.1.11'
depends_on:
- jaeger
- zipkin
networks:
- container-nw
ports:
- 55678:55678
- 55679:55679
command:
- '--config=/etc/ocagent-config.yaml'
volumes:
- './resources/docker/ocagent-config.yaml:/etc/ocagent-config.yaml'
config-server:
build:
context: ./config-server
dockerfile: Dockerfile
depends_on:
- open-census-agent
restart: unless-stopped
ports:
- 8080
networks:
- container-nw
customer-service:
build:
context: ./customer-service
dockerfile: Dockerfile
depends_on:
- database
- config-server
- open-census-agent
command: sh -c " dockerize -timeout 300s -wait-retry-interval 15s
-wait tcp://database:5432
-wait http://config-server:8080/actuator/health
-wait tcp://open-census-agent:55678
java -jar /app.jar"
restart: unless-stopped
ports:
- 8080
environment:
SPRING_CLOUD_CONFIG_URI: 'http://config-server:8080'
OPENCENSUS_AGENT: 'open-census-agent:55678'
networks:
- container-nw
product-service:
build:
context: ./product-service
dockerfile: Dockerfile
depends_on:
- database
- config-server
- open-census-agent
command: sh -c " dockerize -timeout 300s -wait-retry-interval 15s
-wait tcp://database:5432
-wait http://config-server:8080/actuator/health
-wait tcp://open-census-agent:55678
java -jar /app.jar"
restart: unless-stopped
ports:
- 8080
environment:
SPRING_CLOUD_CONFIG_URI: 'http://config-server:8080'
OPENCENSUS_AGENT: 'open-census-agent:55678'
networks:
- container-nw
order-service:
build:
context: ./order-service
dockerfile: Dockerfile
depends_on:
- database
- config-server
- open-census-agent
command: sh -c " dockerize -timeout 300s -wait-retry-interval 15s
-wait tcp://database:5432
-wait http://config-server:8080/actuator/health
-wait tcp://open-census-agent:55678
java -jar /app.jar"
restart: unless-stopped
ports:
- 8080
environment:
SPRING_CLOUD_CONFIG_URI: 'http://config-server:8080'
OPENCENSUS_AGENT: 'open-census-agent:55678'
networks:
- container-nw
bff-service:
build:
context: ./bff-service
dockerfile: Dockerfile
depends_on:
- config-server
- customer-service
- product-service
- order-service
- open-census-agent
command: sh -c " dockerize -timeout 300s -wait-retry-interval 15s
-wait http://config-server:8080/actuator/health
-wait http://customer-service:8080/actuator/health
-wait http://product-service:8080/actuator/health
-wait http://order-service:8080/actuator/health
-wait tcp://open-census-agent:55678
java -jar /app.jar"
restart: unless-stopped
ports:
- 8080
environment:
SPRING_CLOUD_CONFIG_URI: 'http://config-server:8080'
OPENCENSUS_AGENT: 'open-census-agent:55678'
networks:
- container-nw
labels:
- traefik.enable=true
- traefik.http.routers.bff-service.rule=Host(`dev-sandbox`)
- traefik.http.routers.bff-service.entrypoints=http
- traefik.http.services.bff-service.loadbalancer.server.port=8080
load-balancer:
build:
context: ./resources/docker
dockerfile: TraefikCustom-Dockerfile
# image: 'traefik:v2.3'
command: sh -c "
dockerize -timeout 300s -wait-retry-interval 15s
-wait http://bff-service:8080/actuator/health
/entrypoint.sh
--providers.docker=true
--providers.docker.exposedbydefault=false
--entryPoints.http.address=":80"
--accesslog
--log.level=INFO
--api=true
--api.insecure=true
--api.dashboard=true"
restart: unless-stopped
ports:
- '80:80'
- '8080:8080'
volumes:
- '/var/run/docker.sock:/var/run/docker.sock:ro'
networks:
- container-nw
depends_on:
- bff-service
labels:
- traefik.enable=true
- traefik.http.routers.traefik_http.rule=Host(`dev-sandbox`)
- traefik.http.routers.traefik_http.service=api@internal
- traefik.http.routers.traefik_http.entrypoints=http