blob: 82057c501d1111cf94f2e9a2701855a579226e5c [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:
Matteo Scandolodd5fc6a2018-01-19 16:41:52 -0800218 - xos_core:xos
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400219{% if use_redis %}
220 - xos_redis:redis
221{% endif %}
222 depends_on:
Matteo Scandolodd5fc6a2018-01-19 16:41:52 -0800223 - xos_core
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400224{% 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
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400240 xos_core:
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 %}
Sapan Bhatia17b48f92018-01-03 12:42:50 -0500246 command: bash -c "service filebeat start; cd coreapi; bash ./start_coreapi.sh"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400247 ports:
248 - "50051:50051"
249 - "50055:50055"
250 links:
Gopinath Taget4c13da62018-01-19 16:13:19 -0800251 - xos_db:xos-db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700252 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400253{% if use_redis %}
254 - xos_redis:redis
255{% endif %}
256 depends_on:
257 - xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700258 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400259{% if use_redis %}
260 - xos_redis
261{% endif %}
262 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700263 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
264 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700265 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandolob92469d2017-07-28 17:32:00 -0700266 - {{ head_cord_profile_dir }}/initial_data.yaml:/opt/xos/core/migrations/initial_data.yaml:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400267 - /var/run/docker.sock:/var/run/docker.sock
268 logging:
269 driver: "json-file"
270 options:
271 max-size: "1000k"
272 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700273 environment:
274 SERVICE_50051_NAME: "xos-grpc-secure"
275 SERVICE_50055_NAME: "xos-grpc-insecure"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400276 restart: unless-stopped
277
278{% for ext in enabled_gui_extensions %}
279 gui-extension-{{ ext.name }}:
Andy Bavier75e17122017-07-26 09:07:19 -0700280 image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400281 networks:
282{% for network in xos_docker_networks %}
283 - {{ network }}
284{% endfor %}
Matteo Scandolo31634f22017-11-16 10:30:11 -0800285 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 -0400286 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700287 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400288 logging:
289 driver: "json-file"
290 options:
291 max-size: "1000k"
292 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700293 depends_on:
294 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400295{% endfor %}
296
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400297{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700298{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400299 {{ svc.name }}-synchronizer:
Andy Bavier75e17122017-07-26 09:07:19 -0700300 image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400301 networks:
302{% for network in xos_docker_networks %}
303 - {{ network }}
304{% endfor %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400305 depends_on:
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700306 - registrator
307{% if use_redis %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400308 - xos_redis
309{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700310 links:
311 - consul:consul
Matteo Scandolodf7a6a72018-01-11 16:09:38 -0800312 - xos_core:xos-core
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700313{% if use_redis %}
314 - xos_redis:redis
315{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400316 volumes:
Zack Williams9cea13e2017-07-25 16:32:59 -0700317 - {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700318 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
Zack Williams79286962017-07-10 12:24:37 -0700319 - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700320 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400321{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700322 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400323{% endif %}
324{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700325 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400326{% endif %}
327 logging:
328 driver: "json-file"
329 options:
330 max-size: "1000k"
331 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700332 environment:
333 SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400334 restart: unless-stopped
335
336{% endif %}
337{% endfor %}