blob: b3faeafee541a15a55394771dcb57df9f8b7bef3 [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:
Matteo Scandolo893b3d52017-05-18 16:59:53 -070031 consul:
Andy Bavier75e17122017-07-26 09:07:19 -070032 image: {{ pull_docker_registry }}gliderlabs/consul-server:{{ pull_docker_tag }}
Matteo Scandolo893b3d52017-05-18 16:59:53 -070033 command: "-advertise=${MYHOST} -server -bootstrap"
34 ports:
35 - "127.0.0.1:8500:8500"
36 networks:
37{% for network in xos_docker_networks %}
38 - {{ network }}
39{% endfor %}
40 environment:
Matteo Scandolo602dd3e2017-05-25 22:36:15 -070041 SERVICE_8300_IGNORE: "yes"
42 SERVICE_8301_IGNORE: "yes"
43 SERVICE_8302_IGNORE: "yes"
44 SERVICE_8400_IGNORE: "yes"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070045 SERVICE_8500_NAME: "consul-rest"
Matteo Scandolo602dd3e2017-05-25 22:36:15 -070046 SERVICE_8600_IGNORE: "yes"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070047 restart: unless-stopped
48 registrator:
Andy Bavier75e17122017-07-26 09:07:19 -070049 image: {{ pull_docker_registry }}gliderlabs/registrator:{{ pull_docker_tag }}
Matteo Scandolo893b3d52017-05-18 16:59:53 -070050 command: [
51 "-ip=${DOCKER_HOST_IP}",
Matteo Scandolo602dd3e2017-05-25 22:36:15 -070052 "-internal",
Matteo Scandolo893b3d52017-05-18 16:59:53 -070053 "-retry-attempts", "100",
54 "consul://consul:8500"
55 ]
56 networks:
57{% for network in xos_docker_networks %}
58 - {{ network }}
59{% endfor %}
60 links:
61 - consul
62 volumes:
63 - /var/run/docker.sock:/tmp/docker.sock
64 depends_on:
65 - consul
66 restart: unless-stopped
Andy Bavier9e7d54a2017-04-17 11:37:02 -040067 xos_db:
Andy Bavier75e17122017-07-26 09:07:19 -070068 image: {{ pull_docker_registry }}xosproject/xos-postgres:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040069 networks:
70{% for network in xos_docker_networks %}
71 - {{ network }}
72{% endfor %}
73 expose:
74 - "5432"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070075 depends_on:
76 - registrator
77 environment:
78 SERVICE_5432_NAME: "xos-db"
Andy Bavier9e7d54a2017-04-17 11:37:02 -040079 restart: unless-stopped
80
81{% if use_redis %}
82 xos_redis:
Andy Bavier75e17122017-07-26 09:07:19 -070083 image: {{ pull_docker_registry }}redis:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040084 networks:
85{% for network in xos_docker_networks %}
86 - {{ network }}
87{% endfor %}
88 logging:
89 driver: "json-file"
90 options:
91 max-size: "1000k"
92 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070093 depends_on:
94 - registrator
95 environment:
96 SERVICE_NAME: "redis"
Andy Bavier9e7d54a2017-04-17 11:37:02 -040097 restart: unless-stopped
98{% endif %}
99
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700100 xos_gui:
Andy Bavier75e17122017-07-26 09:07:19 -0700101 image: {{ pull_docker_registry }}xosproject/xos-gui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400102 networks:
103{% for network in xos_docker_networks %}
104 - {{ network }}
105{% endfor %}
106 ports:
107 - "4000:4000"
108 links:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700109 - xos_ws:xos-ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400110 - xos_chameleon:xos-chameleon
111 depends_on:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700112 - xos_ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400113 - xos_chameleon
114 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700115 - {{ head_cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js
116 - {{ head_cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400117 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700118 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400119 logging:
120 driver: "json-file"
121 options:
122 max-size: "1000k"
123 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700124 depends_on:
125 - registrator
126 environment:
127 SERVICE_4000_NAME: "xos-gui"
Matteo Scandolo602dd3e2017-05-25 22:36:15 -0700128 SERVICE_80_IGNORE: "yes"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400129 restart: unless-stopped
130
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700131 xos_tosca:
Andy Bavier75e17122017-07-26 09:07:19 -0700132 image: {{ pull_docker_registry }}xosproject/xos-tosca:{{ pull_docker_tag }}
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700133 networks:
134{% for network in xos_docker_networks %}
135 - {{ network }}
136{% endfor %}
137 ports:
138 - "9102:9102"
139 links:
140 - xos_core:xos-core
141 volumes:
142 - {{ head_cord_profile_dir }}/xos-tosca.config.yaml:/opt/xos-tosca/src/xos-tosca.config.yaml
143 depends_on:
144 - xos_core
145 - registrator
146 logging:
147 driver: "json-file"
148 options:
149 max-size: "1000k"
150 max-file: "5"
151 environment:
152 SERVICE_9102_NAME: "xos-tosca"
153 restart: unless-stopped
154
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400155 xos_chameleon:
Andy Bavier75e17122017-07-26 09:07:19 -0700156 image: {{ pull_docker_registry }}xosproject/chameleon:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400157 networks:
158{% for network in xos_docker_networks %}
159 - {{ network }}
160{% endfor %}
Matteo Scandolo7023aa22017-05-09 11:34:52 -0700161 command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400162 ports:
163 - "9101:9101"
164 links:
165 - xos_core:xos-core
166 depends_on:
167 - xos_core
168 logging:
169 driver: "json-file"
170 options:
171 max-size: "1000k"
172 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700173 depends_on:
174 - registrator
175 environment:
176 SERVICE_9101_NAME: "xos-rest"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400177 restart: unless-stopped
178
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700179 gui_extensions_store:
Andy Bavierd2cab422017-07-24 16:38:24 -0700180 image: {{ pull_docker_registry }}node:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400181 networks:
182{% for network in xos_docker_networks %}
183 - {{ network }}
184{% endfor %}
185 command: /bin/true
186 volumes:
187 - /var/www/dist/extensions
188 logging:
189 driver: "json-file"
190 options:
191 max-size: "1000k"
192 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700193 depends_on:
194 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400195
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700196 xos_ws:
Andy Bavier75e17122017-07-26 09:07:19 -0700197 image: {{ pull_docker_registry }}xosproject/xos-ws:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400198 networks:
199{% for network in xos_docker_networks %}
200 - {{ network }}
201{% endfor %}
202 command: npm start -- --config gateway-config.yml
203 ports:
204 - "3000:3000"
205 links:
206 - xos_ui:xos
207{% if use_redis %}
208 - xos_redis:redis
209{% endif %}
210 depends_on:
211 - xos_ui
212{% if use_redis %}
213 - xos_redis
214{% endif %}
215 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700216 - {{ head_cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400217 logging:
218 driver: "json-file"
219 options:
220 max-size: "1000k"
221 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700222 depends_on:
223 - registrator
224 environment:
225 SERVICE_3000_NAME: "xos-ws"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400226 restart: unless-stopped
227
228 xos_ui:
Andy Bavier75e17122017-07-26 09:07:19 -0700229 image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400230 networks:
231{% for network in xos_docker_networks %}
232 - {{ network }}
233{% endfor %}
Matteo Scandolob92469d2017-07-28 17:32:00 -0700234 command: python /opt/xos/manage.py runserver 0.0.0.0:9000 --insecure
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400235 ports:
236 - "9000:9000"
237 links:
238 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700239 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400240{% if use_redis %}
241 - xos_redis:redis
242{% endif %}
243 depends_on:
244 - xos_db
245{% if use_redis %}
246 - xos_redis
247{% endif %}
248 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700249 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
250 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
251 - {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
252 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400253 logging:
254 driver: "json-file"
255 options:
256 max-size: "1000k"
257 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700258 depends_on:
259 - registrator
260 environment:
261 SERVICE_9000_NAME: "xos-ui-deprecated"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400262 restart: unless-stopped
263
264 xos_core:
Andy Bavier75e17122017-07-26 09:07:19 -0700265 image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400266 networks:
267{% for network in xos_docker_networks %}
268 - {{ network }}
269{% endfor %}
270 command: bash -c "cd coreapi; bash ./start_coreapi.sh"
271 ports:
272 - "50051:50051"
273 - "50055:50055"
274 links:
275 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700276 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400277{% if use_redis %}
278 - xos_redis:redis
279{% endif %}
280 depends_on:
281 - xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700282 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400283{% if use_redis %}
284 - xos_redis
285{% endif %}
286 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700287 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
288 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
289 - {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
290 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandolob92469d2017-07-28 17:32:00 -0700291 - {{ head_cord_profile_dir }}/initial_data.yaml:/opt/xos/core/migrations/initial_data.yaml:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400292 - /var/run/docker.sock:/var/run/docker.sock
293 logging:
294 driver: "json-file"
295 options:
296 max-size: "1000k"
297 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700298 environment:
299 SERVICE_50051_NAME: "xos-grpc-secure"
300 SERVICE_50055_NAME: "xos-grpc-insecure"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400301 restart: unless-stopped
302
303{% for ext in enabled_gui_extensions %}
304 gui-extension-{{ ext.name }}:
Andy Bavier75e17122017-07-26 09:07:19 -0700305 image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400306 networks:
307{% for network in xos_docker_networks %}
308 - {{ network }}
309{% endfor %}
310 command: npm run build
311 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700312 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400313 logging:
314 driver: "json-file"
315 options:
316 max-size: "1000k"
317 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700318 depends_on:
319 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400320{% endfor %}
321
322{% if not frontend_only %}
323{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700324{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400325 {{ svc.name }}-synchronizer:
Andy Bavier75e17122017-07-26 09:07:19 -0700326 image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400327 networks:
328{% for network in xos_docker_networks %}
329 - {{ network }}
330{% endfor %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400331 depends_on:
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700332 - registrator
333{% if use_redis %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400334 - xos_redis
335{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700336 links:
337 - consul:consul
338{% if use_redis %}
339 - xos_redis:redis
340{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400341 volumes:
Zack Williams9cea13e2017-07-25 16:32:59 -0700342 - {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700343 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
Zack Williams79286962017-07-10 12:24:37 -0700344 - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700345 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400346{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700347 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400348{% endif %}
349{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700350 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400351{% endif %}
352 logging:
353 driver: "json-file"
354 options:
355 max-size: "1000k"
356 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700357 environment:
358 SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400359 restart: unless-stopped
360
361{% endif %}
362{% endfor %}
363{% endif %}