-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
236 lines (230 loc) · 6.18 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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
version: "3.9"
services:
crud:
build: ./
volumes:
- .:/usr/app
ports:
- "8001-8021:8001"
environment:
ASYNCPG_URL: postgresql+asyncpg://postgres:changeme@postgres:5432/postgres
REDIS_HOST: redis
REDIS_PORT: 6379
REDIS_PASSWORD: default
REPEAT_EVENT: 30
APP_URL: http://crud:8001
PYCTUATOR_ENDPOINT_URL: http://crud:8001/pyctuator
REGISTRATION_URL: http://actuator-admin:8080/instances
METRICS: http://crud.localhost:8001/metrics
DB_CHECK: postgresql+psycopg2://postgres:changeme@postgres:5432/postgres
HOST_JAEGER: jaeger-all-in-one
PORT_JAEGER: 6831
labels:
- "traefik.enable=true"
- "traefik.http.routers.crud.rule=Host(`crud.localhost`)"
depends_on:
- redis
- postgres
restart: always
networks:
- trader-network
deploy:
mode: replicated
replicas: 1
resources:
limits:
cpus: '0.50'
memory: 400M
reservations:
cpus: '0.25'
memory: 400M
restart_policy:
condition: on-failure
delay: 5s
max_attempts: 3
window: 60s
proxy:
image: traefik:v2.8
command:
- '--api.insecure=true'
- '--providers.docker'
- '--providers.docker.endpoint=unix:///var/run/docker.sock'
- '--providers.docker.watch=true'
- '--providers.docker.exposedbydefault=true'
- '--log.level=DEBUG'
- '--entrypoints.web.address=:80'
- '--accessLog'
# - '--tracing.serviceName=traefik'
# - '--tracing.spanNameLimit=250'
# - '--tracing.jaeger=true'
# - '--tracing.jaeger.samplingServerURL=http://jaeger-all-in-one:5778/sampling'
# - '--tracing.jaeger.samplingType=const'
# - '--tracing.jaeger.samplingParam=1.0'
# - '--tracing.jaeger.localAgentHostPort=jaeger-all-in-one:6831'
# - '--tracing.jaeger.propagation=jaeger'
# - '--tracing.jaeger.traceContextHeaderName=uber-trace-id'
# - '--tracing.jaeger.collector.endpoint=http://jaeger-all-in-one:14268/api/traces?format=jaeger.thrift'
- '--metrics.prometheus={}'
volumes:
- /var/run/docker.sock:/var/run/docker.sock
ports:
- '80:80'
- '8080:8080'
networks:
- trader-network
deploy:
resources:
limits:
cpus: '0.50'
memory: 400M
reservations:
cpus: '0.25'
memory: 400M
restart_policy:
#condition: any
delay: 5s
max_attempts: 3
window: 120s
update_config:
delay: 10s
order: start-first
parallelism: 1
rollback_config:
parallelism: 0
order: stop-first
logging:
driver: json-file
options:
'max-size': '10m'
'max-file': '5'
postgres:
image: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
PGDATA: /data/postgres
volumes:
- postgres:/data/postgres
ports:
- "5432:5432"
restart: unless-stopped
networks:
- trader-network
deploy:
resources:
limits:
cpus: '0.50'
memory: 400M
reservations:
cpus: '0.25'
memory: 400M
redis:
image: redislabs/redismod
ports:
- 6379:6379
volumes:
- redis_data:/data/redis
restart: always
networks:
- trader-network
deploy:
resources:
limits:
cpus: '0.50'
memory: 400M
reservations:
cpus: '0.25'
memory: 400M
grafana:
image: grafana/grafana
depends_on:
- prometheus
ports:
- 3000:3000
volumes:
- grafana_data:/var/lib/grafana
- ./grafana/provisioning/:/etc/grafana/provisioning/
env_file:
- ./grafana/config.monitoring
restart: always
networks:
- trader-network
deploy:
resources:
limits:
cpus: '0.50'
memory: 400M
reservations:
cpus: '0.25'
memory: 400M
prometheus:
container_name: prometheus
image: prom/prometheus:latest
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
ports:
- "9090:9090"
networks:
- trader-network
deploy:
resources:
limits:
cpus: '0.50'
memory: 400M
reservations:
cpus: '0.25'
memory: 400M
actuator-admin:
image: michayaak/spring-boot-admin:2.2.3-1
ports:
- "8090:8080"
networks:
- trader-network
# extra_hosts:
# - "host.docker.internal:host-gateway"
labels:
- "traefik.enable=true"
- "traefik.http.routers.actuator-admin.rule=Host(`actuator-admin.localhost`)"
deploy:
resources:
limits:
cpus: '0.50'
memory: 400M
reservations:
cpus: '0.25'
memory: 400M
jaeger-all-in-one:
image: jaegertracing/all-in-one
#command: ["--reporter.grpc.host-port=jaeger-all-in-one:14250", "--reporter.grpc.retry.max=1000"]
ports:
- "6831:6831/udp"
- "16686:16686"
- "14268"
- "14250"
labels:
traefik.http.routers.jaeger.rule: Host(`jaeger.localhost`)
traefik.http.routers.jaeger.entrypoints: web
traefik.http.routers.jaeger.service: jaeger
traefik.http.services.jaeger.loadbalancer.server.port: 16686
networks:
- trader-network
cadvisor:
image: gcr.io/cadvisor/cadvisor
volumes:
- /:/rootfs:ro
- /var/run:/var/run:rw
- /sys:/sys:ro
- /var/lib/docker/:/var/lib/docker:ro
ports:
- 9080:8080
networks:
- trader-network
restart: always
deploy:
mode: global
volumes:
redis_data: {}
postgres: {}
grafana_data: {}
networks:
trader-network: