-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.swarm.yml
202 lines (183 loc) · 6.99 KB
/
docker-compose.swarm.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
version: "3.8"
services:
api:
networks:
- default
- traefik
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.mlmodelscope-api.rule=Host(`api.${ENVIRONMENT}mlmodelscope.org`)"
- "traefik.http.routers.mlmodelscope-api.entrypoints=websecure"
- "traefik.http.routers.mlmodelscope-api.tls.certresolver=letsencrypt"
- "traefik.http.services.mlmodelscope-api.loadbalancer.server.port=8080"
- "traefik.http.middlewares.add-cors.headers.accessControlAllowMethods=GET,OPTIONS,PUT,DELETE"
- "traefik.http.middlewares.add-cors.headers.accesscontrolalloworiginlist=https://${ENVIRONMENT}mlmodelscope.org"
- "traefik.http.middlewares.add-cors.headers.accessControlAllowCredentials=true"
- "traefik.http.middlewares.add-cors.headers.accessControlAllowHeaders=origin,x-requested-with,content-type,accept,x-request-id"
- "traefik.http.middlewares.add-cors.headers.accesscontrolmaxage=100"
- "traefik.http.middlewares.add-cors.headers.addvaryheader=true"
- "traefik.http.routers.mlmodelscope-api.middlewares=add-cors"
companion:
networks:
- default
- traefik
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.mlmodelscope-companion.rule=Host(`companion.${ENVIRONMENT}mlmodelscope.org`)"
- "traefik.http.routers.mlmodelscope-companion.entrypoints=websecure"
- "traefik.http.routers.mlmodelscope-companion.tls.certresolver=letsencrypt"
- "traefik.http.services.mlmodelscope-companion.loadbalancer.server.port=3020"
- "traefik.http.middlewares.add-cors-companion.headers.accessControlAllowMethods=GET,OPTIONS,POST"
- "traefik.http.middlewares.add-cors-companion.headers.accesscontrolalloworiginlist=https://${ENVIRONMENT}mlmodelscope.org"
- "traefik.http.middlewares.add-cors-companion.headers.accessControlAllowCredentials=true"
- "traefik.http.middlewares.add-cors-companion.headers.accessControlAllowHeaders=origin,content-type,accept,uppy-versions"
- "traefik.http.middlewares.add-cors-companion.headers.accesscontrolmaxage=100"
- "traefik.http.middlewares.add-cors-companion.headers.addvaryheader=true"
- "traefik.http.routers.mlmodelscope-companion.middlewares=add-cors-companion"
environment:
COMPANION_AWS_KEY: "$COMPANION_AWS_KEY"
COMPANION_AWS_SECRET: "$COMPANION_AWS_SECRET"
COMPANION_AWS_BUCKET: "$COMPANION_AWS_BUCKET"
COMPANION_AWS_REGION: "$COMPANION_AWS_REGION"
COMPANION_DOMAIN: "https://companion.${ENVIRONMENT}mlmodelscope.org"
volumes:
- staging-companion-data:/data
mq:
networks:
- default
- traefik
ports:
- "5672:5672"
- "15672:15672"
- "15692:15692"
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.mlmodelscope-mq.rule=Host(`mq.${ENVIRONMENT}mlmodelscope.org`)"
- "traefik.http.routers.mlmodelscope-mq.entrypoints=websecure"
- "traefik.http.routers.mlmodelscope-mq.tls.certresolver=letsencrypt"
- "traefik.http.services.mlmodelscope-mq.loadbalancer.server.port=15672"
configs:
- source: rabbitmq_config
target: /etc/rabbitmq/rabbitmq.conf
- source: rabbitmq_definitions
target: /etc/rabbitmq/definitions.json
environment:
RABBITMQ_NODENAME: "$RABBITMQ_NODENAME"
volumes:
- staging-rabbit-efs:/var/lib/rabbitmq/mnesia
consul:
configs:
- source: consul_config
target: /consul/config/server.json
volumes:
- consul_data:/consul/data
trace:
image: jaegertracing/all-in-one:1.45
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.trace.rule=Host(`trace.${ENVIRONMENT}mlmodelscope.org`)"
- "traefik.http.routers.trace.entrypoints=websecure"
- "traefik.http.routers.trace.tls.certresolver=letsencrypt"
- "traefik.http.services.trace.loadbalancer.server.port=16686"
environment:
- COLLECTOR_ZIPKIN_HTTP_PORT=9411
- COLLECTOR_OTLP_ENABLED=true
- COLLECTOR_OTLP_ENDPOINT=https://otel.${ENVIRONMENT}mlmodelscope.org:4318/v1/traces
- OTLP_EXPORTER_ENDPOINT=https://otel.${ENVIRONMENT}mlmodelscope.org:4318/v1/traces
ports:
- "5775:5775/udp"
- "6831:6831/udp"
- "6832:6832/udp"
- "5778:5778"
- "16686:16686"
- "14268:14268"
- "14250:14250"
- "9200:9200"
- "9411:9411"
networks:
- default
- traefik
collector:
image: otel/opentelemetry-collector:latest
command: ["--config=/etc/otel-collector-config.yaml"]
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.collector.rule=Host(`otel.${ENVIRONMENT}mlmodelscope.org`)"
- "traefik.http.routers.collector.entrypoints=websecure"
- "traefik.http.routers.collector.tls.certresolver=letsencrypt"
- "traefik.http.services.collector.loadbalancer.server.port=4318"
volumes:
- /etc/otel-collector-config.yaml:/etc/otel-collector-config.yaml:ro
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
depends_on:
- trace
networks:
- default
- traefik
### Monitoring services
grafana:
configs:
- source: grafana_dashboards_config
target: /etc/grafana/provisioning/dashboards/rabbitmq.yaml
- source: grafana_prometheus_datasource
target: /etc/grafana/provisioning/datasources/prometheus.yaml
deploy:
labels:
- "traefik.enable=true"
- "traefik.docker.network=traefik"
- "traefik.http.routers.grafana.rule=Host(`monitoring.${ENVIRONMENT}mlmodelscope.org`)"
- "traefik.http.routers.grafana.entrypoints=websecure"
- "traefik.http.routers.grafana.tls.certresolver=letsencrypt"
- "traefik.http.services.grafana.loadbalancer.server.port=3000"
networks:
- default
- traefik
volumes:
- grafana_dashboards:/dashboards
- grafana_data:/var/lib/grafana
prometheus:
configs:
- source: prometheus_config
target: /etc/prometheus/prometheus.yml
volumes:
- prometheus_data:/prometheus
configs:
consul_config:
external: true
grafana_dashboards_config:
external: true
grafana_prometheus_datasource:
external: true
prometheus_config:
external: true
rabbitmq_config:
external: true
rabbitmq_definitions:
external: true
networks:
traefik:
external: true
name: traefik
volumes:
staging-rabbit-efs:
external: true
staging-companion-data:
consul_data:
grafana_dashboards:
grafana_data:
prometheus_data: