blob: 0efc344cc0fb712f0e8beb6ed6506b6ba1093c39 [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001
2{#
3Copyright 2017-present Open Networking Foundation
4
5Licensed under the Apache License, Version 2.0 (the "License");
6you may not use this file except in compliance with the License.
7You may obtain a copy of the License at
8
9http://www.apache.org/licenses/LICENSE-2.0
10
11Unless required by applicable law or agreed to in writing, software
12distributed under the License is distributed on an "AS IS" BASIS,
13WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14See the License for the specific language governing permissions and
15limitations under the License.
16#}
17
18
Andy Bavier9e7d54a2017-04-17 11:37:02 -040019version: '2'
20
21# XOS docker compose
Zack Williamsc989f262017-05-11 13:02:59 -070022# generated by cord-profile/templates/docker-compose.yml.j2
Andy Bavier9e7d54a2017-04-17 11:37:02 -040023
24networks:
25{% for network in xos_docker_networks %}
26 {{ network }}:
27 external: true
28{% endfor %}
29
30services:
Varun Belur86764532017-09-08 18:39:58 -060031{% if use_elasticstack %}
32 elk:
33 image: {{ pull_docker_registry }}sebp/elk:{{ pull_docker_tag }}
34 ports:
35 - "5601:5601"
36 - "9200:9200"
37 networks:
38{% for network in xos_docker_networks %}
39 - {{ network }}
40{% endfor %}
41{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -070042 consul:
Andy Bavier75e17122017-07-26 09:07:19 -070043 image: {{ pull_docker_registry }}gliderlabs/consul-server:{{ pull_docker_tag }}
Matteo Scandolo893b3d52017-05-18 16:59:53 -070044 command: "-advertise=${MYHOST} -server -bootstrap"
45 ports:
46 - "127.0.0.1:8500:8500"
47 networks:
48{% for network in xos_docker_networks %}
49 - {{ network }}
50{% endfor %}
51 environment:
Matteo Scandolo602dd3e2017-05-25 22:36:15 -070052 SERVICE_8300_IGNORE: "yes"
53 SERVICE_8301_IGNORE: "yes"
54 SERVICE_8302_IGNORE: "yes"
55 SERVICE_8400_IGNORE: "yes"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070056 SERVICE_8500_NAME: "consul-rest"
Matteo Scandolo602dd3e2017-05-25 22:36:15 -070057 SERVICE_8600_IGNORE: "yes"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070058 restart: unless-stopped
59 registrator:
Andy Bavier75e17122017-07-26 09:07:19 -070060 image: {{ pull_docker_registry }}gliderlabs/registrator:{{ pull_docker_tag }}
Matteo Scandolo893b3d52017-05-18 16:59:53 -070061 command: [
62 "-ip=${DOCKER_HOST_IP}",
Matteo Scandolo602dd3e2017-05-25 22:36:15 -070063 "-internal",
Matteo Scandolo893b3d52017-05-18 16:59:53 -070064 "-retry-attempts", "100",
65 "consul://consul:8500"
66 ]
67 networks:
68{% for network in xos_docker_networks %}
69 - {{ network }}
70{% endfor %}
71 links:
72 - consul
73 volumes:
74 - /var/run/docker.sock:/tmp/docker.sock
75 depends_on:
76 - consul
77 restart: unless-stopped
Andy Bavier9e7d54a2017-04-17 11:37:02 -040078 xos_db:
Andy Bavier75e17122017-07-26 09:07:19 -070079 image: {{ pull_docker_registry }}xosproject/xos-postgres:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040080 networks:
81{% for network in xos_docker_networks %}
82 - {{ network }}
83{% endfor %}
84 expose:
85 - "5432"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070086 depends_on:
87 - registrator
88 environment:
89 SERVICE_5432_NAME: "xos-db"
Andy Bavier9e7d54a2017-04-17 11:37:02 -040090 restart: unless-stopped
91
92{% if use_redis %}
93 xos_redis:
Andy Bavier75e17122017-07-26 09:07:19 -070094 image: {{ pull_docker_registry }}redis:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040095 networks:
96{% for network in xos_docker_networks %}
97 - {{ network }}
98{% endfor %}
99 logging:
100 driver: "json-file"
101 options:
102 max-size: "1000k"
103 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700104 depends_on:
105 - registrator
106 environment:
107 SERVICE_NAME: "redis"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400108 restart: unless-stopped
109{% endif %}
110
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700111 xos_gui:
Andy Bavier75e17122017-07-26 09:07:19 -0700112 image: {{ pull_docker_registry }}xosproject/xos-gui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400113 networks:
114{% for network in xos_docker_networks %}
115 - {{ network }}
116{% endfor %}
117 ports:
118 - "4000:4000"
119 links:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700120 - xos_ws:xos-ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400121 - xos_chameleon:xos-chameleon
122 depends_on:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700123 - xos_ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400124 - xos_chameleon
125 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700126 - {{ head_cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js
127 - {{ head_cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400128 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700129 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400130 logging:
131 driver: "json-file"
132 options:
133 max-size: "1000k"
134 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700135 depends_on:
136 - registrator
137 environment:
138 SERVICE_4000_NAME: "xos-gui"
Matteo Scandolo602dd3e2017-05-25 22:36:15 -0700139 SERVICE_80_IGNORE: "yes"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400140 restart: unless-stopped
141
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700142 xos_tosca:
Andy Bavier75e17122017-07-26 09:07:19 -0700143 image: {{ pull_docker_registry }}xosproject/xos-tosca:{{ pull_docker_tag }}
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700144 networks:
145{% for network in xos_docker_networks %}
146 - {{ network }}
147{% endfor %}
148 ports:
149 - "9102:9102"
150 links:
151 - xos_core:xos-core
152 volumes:
153 - {{ head_cord_profile_dir }}/xos-tosca.config.yaml:/opt/xos-tosca/src/xos-tosca.config.yaml
Matteo Scandolo9b5e6682017-09-13 08:51:20 -0700154 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700155 depends_on:
156 - xos_core
157 - registrator
158 logging:
159 driver: "json-file"
160 options:
161 max-size: "1000k"
162 max-file: "5"
163 environment:
164 SERVICE_9102_NAME: "xos-tosca"
165 restart: unless-stopped
166
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400167 xos_chameleon:
Andy Bavier75e17122017-07-26 09:07:19 -0700168 image: {{ pull_docker_registry }}xosproject/chameleon:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400169 networks:
170{% for network in xos_docker_networks %}
171 - {{ network }}
172{% endfor %}
Matteo Scandolo7023aa22017-05-09 11:34:52 -0700173 command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400174 ports:
175 - "9101:9101"
176 links:
177 - xos_core:xos-core
178 depends_on:
179 - xos_core
180 logging:
181 driver: "json-file"
182 options:
183 max-size: "1000k"
184 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700185 depends_on:
186 - registrator
187 environment:
188 SERVICE_9101_NAME: "xos-rest"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400189 restart: unless-stopped
190
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700191 gui_extensions_store:
Andy Bavierd2cab422017-07-24 16:38:24 -0700192 image: {{ pull_docker_registry }}node:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400193 networks:
194{% for network in xos_docker_networks %}
195 - {{ network }}
196{% endfor %}
197 command: /bin/true
198 volumes:
199 - /var/www/dist/extensions
200 logging:
201 driver: "json-file"
202 options:
203 max-size: "1000k"
204 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700205 depends_on:
206 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400207
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700208 xos_ws:
Andy Bavier75e17122017-07-26 09:07:19 -0700209 image: {{ pull_docker_registry }}xosproject/xos-ws:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400210 networks:
211{% for network in xos_docker_networks %}
212 - {{ network }}
213{% endfor %}
214 command: npm start -- --config gateway-config.yml
215 ports:
216 - "3000:3000"
217 links:
218 - xos_ui:xos
219{% if use_redis %}
220 - xos_redis:redis
221{% endif %}
222 depends_on:
223 - xos_ui
224{% if use_redis %}
225 - xos_redis
226{% endif %}
227 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700228 - {{ head_cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400229 logging:
230 driver: "json-file"
231 options:
232 max-size: "1000k"
233 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700234 depends_on:
235 - registrator
236 environment:
237 SERVICE_3000_NAME: "xos-ws"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400238 restart: unless-stopped
239
240 xos_ui:
Andy Bavier75e17122017-07-26 09:07:19 -0700241 image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400242 networks:
243{% for network in xos_docker_networks %}
244 - {{ network }}
245{% endfor %}
Matteo Scandoloc111b442017-08-24 13:27:34 -0700246 command: python /opt/xos/manage.py runserver 0.0.0.0:9000
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400247 ports:
248 - "9000:9000"
249 links:
250 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700251 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400252{% if use_redis %}
253 - xos_redis:redis
254{% endif %}
255 depends_on:
256 - xos_db
257{% if use_redis %}
258 - xos_redis
259{% endif %}
260 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700261 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
262 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700263 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400264 logging:
265 driver: "json-file"
266 options:
267 max-size: "1000k"
268 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700269 depends_on:
270 - registrator
271 environment:
272 SERVICE_9000_NAME: "xos-ui-deprecated"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400273 restart: unless-stopped
274
275 xos_core:
Andy Bavier75e17122017-07-26 09:07:19 -0700276 image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400277 networks:
278{% for network in xos_docker_networks %}
279 - {{ network }}
280{% endfor %}
281 command: bash -c "cd coreapi; bash ./start_coreapi.sh"
282 ports:
283 - "50051:50051"
284 - "50055:50055"
285 links:
286 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700287 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400288{% if use_redis %}
289 - xos_redis:redis
290{% endif %}
291 depends_on:
292 - xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700293 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400294{% if use_redis %}
295 - xos_redis
296{% endif %}
297 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700298 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
299 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700300 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandolob92469d2017-07-28 17:32:00 -0700301 - {{ head_cord_profile_dir }}/initial_data.yaml:/opt/xos/core/migrations/initial_data.yaml:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400302 - /var/run/docker.sock:/var/run/docker.sock
303 logging:
304 driver: "json-file"
305 options:
306 max-size: "1000k"
307 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700308 environment:
309 SERVICE_50051_NAME: "xos-grpc-secure"
310 SERVICE_50055_NAME: "xos-grpc-insecure"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400311 restart: unless-stopped
312
313{% for ext in enabled_gui_extensions %}
314 gui-extension-{{ ext.name }}:
Andy Bavier75e17122017-07-26 09:07:19 -0700315 image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400316 networks:
317{% for network in xos_docker_networks %}
318 - {{ network }}
319{% endfor %}
Matteo Scandolo31634f22017-11-16 10:30:11 -0800320 command: /bin/sh -c "mkdir -p /var/www/dist/extensions/{{ ext.name }}/ && cp -R /tmp/* /var/www/dist/extensions/{{ ext.name }}/"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400321 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700322 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400323 logging:
324 driver: "json-file"
325 options:
326 max-size: "1000k"
327 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700328 depends_on:
329 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400330{% endfor %}
331
332{% if not frontend_only %}
333{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700334{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400335 {{ svc.name }}-synchronizer:
Andy Bavier75e17122017-07-26 09:07:19 -0700336 image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400337 networks:
338{% for network in xos_docker_networks %}
339 - {{ network }}
340{% endfor %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400341 depends_on:
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700342 - registrator
343{% if use_redis %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400344 - xos_redis
345{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700346 links:
347 - consul:consul
348{% if use_redis %}
349 - xos_redis:redis
350{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400351 volumes:
Zack Williams9cea13e2017-07-25 16:32:59 -0700352 - {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700353 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
Zack Williams79286962017-07-10 12:24:37 -0700354 - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700355 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400356{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700357 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400358{% endif %}
359{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700360 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400361{% endif %}
362 logging:
363 driver: "json-file"
364 options:
365 max-size: "1000k"
366 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700367 environment:
368 SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400369 restart: unless-stopped
370
371{% endif %}
372{% endfor %}
373{% endif %}