forked from apache/trafficcontrol
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
318 lines (300 loc) · 8.79 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
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
#
# To use this compose you should first build Traffic Ops and then copy the RPM to :
#
# trafficcontrol/infrastructure/cdn-in-a-box/traffic_ops/traffic_ops.rpm
#
# cd trafficcontrol/infrastructure/cdn-in-a-box
#
# Adjust the settings in `variables.env` to suit your needs.
#
# docker-compose up -d
#
# The Traffic Ops API will then be available on https://localhost:6443,
# and the postgres database on localhost 5432.
#
# Note that this setup is intended for testing and not for production use.
---
version: '3.8'
services:
# db is the Traffic Ops database running in postgresql. Only trafficops needs to have access to it.
# All other components access the database thru the Traffic Ops API
db:
build:
context: .
dockerfile: traffic_ops/Dockerfile-db
hostname: db
domainname: infra.ciab.test
depends_on:
- dns
volumes:
- /var/lib/postgresql/data
- shared:/shared
env_file:
- variables.env
# TODO: change to expose: "5432" to limit to containers
# trafficops runs Traffic Ops in a container.
trafficops:
build:
context: ../../
dockerfile: infrastructure/cdn-in-a-box/traffic_ops/Dockerfile
args:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_OPS_RPM: infrastructure/cdn-in-a-box/traffic_ops/traffic_ops.rpm
depends_on:
- db
- enroller
- smtp
domainname: infra.ciab.test
env_file:
- variables.env
environment:
SKIP_DIG_IP: ${SKIP_DIG_IP:-false}
SKIP_TRAFFIC_OPS_DATA: ${SKIP_TRAFFIC_OPS_DATA:-false}
hostname: trafficops
image: trafficops
volumes:
- shared:/shared
- ./traffic_ops/ca:/ca
- traffic_ops_data:/traffic_ops_data
# trafficportal defines the web interface for Traffic Ops. It uses only the API exposed by Traffic Ops
# and passes any /api/... routes directly to Traffic Ops
trafficportal:
build:
context: .
dockerfile: traffic_portal/Dockerfile
args:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_PORTAL_RPM: traffic_portal/traffic_portal.rpm
depends_on:
- enroller
domainname: infra.ciab.test
env_file:
- variables.env
hostname: trafficportal
image: trafficportal
volumes:
- shared:/shared
# trafficmonitor is an HTTP service that monitors the caches in a CDN for a variety of metrics
trafficmonitor:
build:
context: .
dockerfile: traffic_monitor/Dockerfile
args:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_MONITOR_RPM: traffic_monitor/traffic_monitor.rpm
depends_on:
- enroller
volumes:
- shared:/shared
domainname: infra.ciab.test
env_file:
- variables.env
hostname: trafficmonitor
image: trafficmonitor
# trafficrouter routes clients to the most optimal cache
trafficrouter:
build:
context: .
dockerfile: traffic_router/Dockerfile
args:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_ROUTER_RPM: traffic_router/traffic_router.rpm
TOMCAT_RPM: traffic_router/tomcat.rpm
depends_on:
- enroller
domainname: infra.ciab.test
env_file:
- variables.env
hostname: trafficrouter
volumes:
- shared:/shared
# trafficstats collect traffic information
trafficstats:
build:
context: .
dockerfile: traffic_stats/Dockerfile
args:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
TRAFFIC_TS_RPM: traffic_stats/traffic_stats.rpm
image: trafficstats
depends_on:
- enroller
- influxdb
domainname: infra.ciab.test
env_file:
- variables.env
hostname: trafficstats
volumes:
- shared:/shared
influxdb:
build:
context: .
dockerfile: traffic_stats/Dockerfile-influxdb
hostname: influxdb
domainname: infra.ciab.test
depends_on:
- dns
env_file:
- variables.env
volumes:
- shared:/shared
# edge cache
edge:
build:
context: ../..
dockerfile: infrastructure/cdn-in-a-box/cache/Dockerfile
target: edge
args:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
ORT_RPM: infrastructure/cdn-in-a-box/cache/trafficcontrol-cache-config.rpm
domainname: infra.ciab.test
environment:
DEBUG_PORT: '2347'
env_file:
- variables.env
hostname: edge
volumes:
# The /traffic_ops_data volume is included to set the ATS RPM version in the MID profile.
- traffic_ops_data:/traffic_ops_data
- shared:/shared
# mid cache 1
mid-01:
build:
context: ../..
dockerfile: infrastructure/cdn-in-a-box/cache/Dockerfile
target: mid
args:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
ORT_RPM: infrastructure/cdn-in-a-box/cache/trafficcontrol-cache-config.rpm
domainname: infra.ciab.test
environment:
DEBUG_PORT: '2348'
env_file:
- variables.env
hostname: mid-01
volumes:
# The /traffic_ops_data volume is included to set the ATS RPM version in the MID profile.
- traffic_ops_data:/traffic_ops_data
- shared:/shared
# mid cache 2
mid-02:
build:
context: ../..
dockerfile: infrastructure/cdn-in-a-box/cache/Dockerfile
target: mid
args:
# Change BASE_IMAGE to centos when RHEL_VERSION=7
BASE_IMAGE: ${BASE_IMAGE:-rockylinux}
RHEL_VERSION: ${RHEL_VERSION:-8}
ORT_RPM: infrastructure/cdn-in-a-box/cache/trafficcontrol-cache-config.rpm
domainname: infra.ciab.test
environment:
DEBUG_PORT: '2349'
env_file:
- variables.env
hostname: mid-02
volumes:
# The /traffic_ops_data volume is included to set the ATS RPM version in the MID profile.
- traffic_ops_data:/traffic_ops_data
- shared:/shared
# origin provides the content to be distributed through the CDN caches
origin:
build:
context: .
dockerfile: origin/Dockerfile
depends_on:
- enroller
domainname: infra.ciab.test
env_file:
- variables.env
hostname: origin
volumes:
- shared:/shared
# enroller provides a way to register component instances with traffic_ops
enroller:
build:
context: ../..
dockerfile: infrastructure/cdn-in-a-box/enroller/Dockerfile
domainname: infra.ciab.test
depends_on:
- dns
env_file:
- variables.env
hostname: enroller
volumes:
- shared:/shared
# Bind9 DNS services work in combination with the traffic router to route clients to the optimal cache
dns:
build:
context: .
dockerfile: dns/Dockerfile
env_file:
- variables.env
volumes:
- shared:/shared
hostname: dns
domainname: infra.ciab.test
smtp:
build:
context: .
dockerfile: smtp/Dockerfile
hostname: smtp
depends_on:
- dns
env_file:
- variables.env
volumes:
- shared:/shared
domainname: infra.ciab.test
# static provides the MaxMind databases and coverage-zone.json, which used to be served by Traffic Ops Perl.
static:
build:
context: ../..
dockerfile: infrastructure/cdn-in-a-box/static/Dockerfile
domainname: infra.ciab.test
hostname: static
env_file:
- variables.env
volumes:
- shared:/shared
volumes:
schemas:
external: false
shared:
external: false
traffic_ops_data:
external: false
content:
external: false
ca:
external: false