-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yaml
223 lines (210 loc) · 5.8 KB
/
docker-compose.yaml
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
version: '3.6'
services:
origin:
image: "httpd:2-alpine"
restart: always
hostname: origin.example.com
volumes:
- ./website/:/usr/local/apache2/htdocs
networks:
default:
ipv4_address: 172.31.0.200
varnish1:
container_name: varnish1
image: "quay.io/varnish-software/varnish-plus:latest"
hostname: cache1.example.com
restart: always
volumes:
- type: "volume"
source: vcontroller
target: /etc/varnish
- type: "volume"
source: varnish
target: /var/lib/varnish
environment:
- "VARNISH_ADMIN_LISTEN_ADDRESS=0.0.0.0"
- "VARNISH_LISTEN_PORT=80"
networks:
default:
ipv4_address: 172.31.0.201
varnish2:
container_name: varnish2
image: "quay.io/varnish-software/varnish-plus:latest"
hostname: cache2.example.com
restart: always
volumes:
- type: "volume"
source: vcontroller
target: /etc/varnish
- type: "volume"
source: varnish
target: /var/lib/varnish
environment:
- "VARNISH_ADMIN_LISTEN_ADDRESS=0.0.0.0"
- "VARNISH_LISTEN_PORT=80"
networks:
default:
ipv4_address: 172.31.0.202
router:
container_name: router
image: 'quay.io/varnish-software/varnish-controller-router:latest'
hostname: router
restart: always
volumes:
- type: "volume"
source: vcontroller
target: /etc/varnish
environment:
- "VARNISH_CONTROLLER_ROUTER_NAME=router"
- "VARNISH_CONTROLLER_BASE_DIR=/etc/varnish/routers/"
- "VARNISH_CONTROLLER_NATS_SERVER=nats:4222"
- "VARNISH_CONTROLLER_HTTP_PORT=80"
- "VARNISH_CONTROLLER_HTTP_HOST=0.0.0.0"
depends_on:
- nats
expose:
- "80"
networks:
default:
ipv4_address: 172.31.0.203
agent1:
container_name: agent1
image: 'quay.io/varnish-software/varnish-controller-agent:latest'
hostname: agent1
restart: always
volumes:
- type: "volume"
source: vcontroller
target: /etc/varnish
- type: "volume"
source: varnish
target: /var/lib/varnish
links:
- varnish1
- nats
environment:
- "VARNISH_CONTROLLER_AGENT_NAME=server1"
- "VARNISH_CONTROLLER_BASE_DIR=/etc/varnish/agents/"
- "VARNISH_CONTROLLER_NATS_SERVER=nats:4222"
- "VARNISH_CONTROLLER_VARNISH_NAME=cache1.example.com"
- "VARNISH_CONTROLLER_VARNISH_HOST=172.31.0.201:6081"
- "VARNISH_CONTROLLER_BASE_URL=http://cache1.example.com"
- "VARNISH_CONTROLLER_IPV6=::1"
- "VARNISH_CONTROLLER_IPV4=172.31.0.204"
depends_on:
- nats
networks:
default:
ipv4_address: 172.31.0.204
agent2:
container_name: agent2
image: 'quay.io/varnish-software/varnish-controller-agent:latest'
hostname: agent2
restart: always
volumes:
- type: "volume"
source: vcontroller
target: /etc/varnish
- type: "volume"
source: varnish
target: /var/lib/varnish
links:
- varnish2
- nats
environment:
- "VARNISH_CONTROLLER_AGENT_NAME=server2"
- "VARNISH_CONTROLLER_BASE_DIR=/etc/varnish/agents/"
- "VARNISH_CONTROLLER_NATS_SERVER=nats:4222"
- "VARNISH_CONTROLLER_VARNISH_NAME=cache2.example.com"
- "VARNISH_CONTROLLER_VARNISH_HOST=172.31.0.202:6081"
- "VARNISH_CONTROLLER_BASE_URL=http://cache2.example.com"
- "VARNISH_CONTROLLER_IPV6=::1"
- "VARNISH_CONTROLLER_IPV4=172.31.0.205"
depends_on:
- nats
networks:
default:
ipv4_address: 172.31.0.205
apigw:
container_name: apigw
image: 'quay.io/varnish-software/varnish-controller-api-gw:latest'
hostname: apigw
restart: always
environment:
- "VARNISH_CONTROLLER_NATS_SERVER=nats:4222"
depends_on:
- nats
- brainz
networks:
default:
ipv4_address: 172.31.0.206
brainz:
container_name: brainz
image: 'quay.io/varnish-software/varnish-controller-brainz:latest'
hostname: brainz
restart: always
volumes:
- ./router_license.lic:/var/lib/varnish-controller/varnish-controller-brainz/license.lic
links:
- nats
environment:
- "VARNISH_CONTROLLER_NATS_SERVER=nats:4222"
- "VARNISH_CONTROLLER_DB_USER=varnish-controller"
- "VARNISH_CONTROLLER_DB_PASS=varnish-controller"
- "VARNISH_CONTROLLER_DB_NAME=varnish-controller"
- "VARNISH_CONTROLLER_DB_SERVER=db"
- "VARNISH_CONTROLLER_MOD_ADMIN_USER=true"
- "VARNISH_CONTROLLER_SYSTEM_ADMIN_USER=test"
- "VARNISH_CONTROLLER_SYSTEM_ADMIN_PASS=test"
depends_on:
- db
- nats
networks:
default:
ipv4_address: 172.31.0.207
controller-ui:
container_name: controllerui
image: 'quay.io/varnish-software/varnish-controller-ui:latest'
hostname: ui
restart: always
environment:
- "VARNISH_UI_SERVER_API_HOSTS=http://apigw:8002"
- "VARNISH_UI_SERVER_CSP=false"
- "VARNISH_UI_SERVER_HTTP_PORT=80"
depends_on:
- apigw
networks:
default:
ipv4_address: 172.31.0.208
db:
container_name: psql
image: postgres
hostname: db
restart: always
volumes:
- dbdata:/var/lib/postgresql/data
environment:
POSTGRES_USER: varnish-controller
POSTGRES_PASSWORD: varnish-controller
networks:
default:
ipv4_address: 172.31.0.209
nats:
container_name: nats
image: 'quay.io/varnish-software/varnish-controller-nats:latest'
hostname: nats
restart: always
expose:
- "4222"
networks:
default:
ipv4_address: 172.31.0.210
volumes:
vcontroller:
dbdata:
varnish:
networks:
default:
ipam:
config:
- subnet: 172.31.0.0/16