blob: cd907653533ca7482a99f429b55a1d64b4c9d064 [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
Matteo Scandolo9b5e6682017-09-13 08:51:20 -0700143 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700144 depends_on:
145 - xos_core
146 - registrator
147 logging:
148 driver: "json-file"
149 options:
150 max-size: "1000k"
151 max-file: "5"
152 environment:
153 SERVICE_9102_NAME: "xos-tosca"
154 restart: unless-stopped
155
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400156 xos_chameleon:
Andy Bavier75e17122017-07-26 09:07:19 -0700157 image: {{ pull_docker_registry }}xosproject/chameleon:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400158 networks:
159{% for network in xos_docker_networks %}
160 - {{ network }}
161{% endfor %}
Matteo Scandolo7023aa22017-05-09 11:34:52 -0700162 command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400163 ports:
164 - "9101:9101"
165 links:
166 - xos_core:xos-core
167 depends_on:
168 - xos_core
169 logging:
170 driver: "json-file"
171 options:
172 max-size: "1000k"
173 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700174 depends_on:
175 - registrator
176 environment:
177 SERVICE_9101_NAME: "xos-rest"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400178 restart: unless-stopped
179
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700180 gui_extensions_store:
Andy Bavierd2cab422017-07-24 16:38:24 -0700181 image: {{ pull_docker_registry }}node:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400182 networks:
183{% for network in xos_docker_networks %}
184 - {{ network }}
185{% endfor %}
186 command: /bin/true
187 volumes:
188 - /var/www/dist/extensions
189 logging:
190 driver: "json-file"
191 options:
192 max-size: "1000k"
193 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700194 depends_on:
195 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400196
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700197 xos_ws:
Andy Bavier75e17122017-07-26 09:07:19 -0700198 image: {{ pull_docker_registry }}xosproject/xos-ws:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400199 networks:
200{% for network in xos_docker_networks %}
201 - {{ network }}
202{% endfor %}
203 command: npm start -- --config gateway-config.yml
204 ports:
205 - "3000:3000"
206 links:
207 - xos_ui:xos
208{% if use_redis %}
209 - xos_redis:redis
210{% endif %}
211 depends_on:
212 - xos_ui
213{% if use_redis %}
214 - xos_redis
215{% endif %}
216 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700217 - {{ head_cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400218 logging:
219 driver: "json-file"
220 options:
221 max-size: "1000k"
222 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700223 depends_on:
224 - registrator
225 environment:
226 SERVICE_3000_NAME: "xos-ws"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400227 restart: unless-stopped
228
229 xos_ui:
Andy Bavier75e17122017-07-26 09:07:19 -0700230 image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400231 networks:
232{% for network in xos_docker_networks %}
233 - {{ network }}
234{% endfor %}
Matteo Scandoloc111b442017-08-24 13:27:34 -0700235 command: python /opt/xos/manage.py runserver 0.0.0.0:9000
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400236 ports:
237 - "9000:9000"
238 links:
239 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700240 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400241{% if use_redis %}
242 - xos_redis:redis
243{% endif %}
244 depends_on:
245 - xos_db
246{% if use_redis %}
247 - xos_redis
248{% endif %}
249 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700250 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
251 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700252 - {{ 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
Zack Williamsc989f262017-05-11 13:02:59 -0700289 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandolob92469d2017-07-28 17:32:00 -0700290 - {{ head_cord_profile_dir }}/initial_data.yaml:/opt/xos/core/migrations/initial_data.yaml:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400291 - /var/run/docker.sock:/var/run/docker.sock
292 logging:
293 driver: "json-file"
294 options:
295 max-size: "1000k"
296 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700297 environment:
298 SERVICE_50051_NAME: "xos-grpc-secure"
299 SERVICE_50055_NAME: "xos-grpc-insecure"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400300 restart: unless-stopped
301
302{% for ext in enabled_gui_extensions %}
303 gui-extension-{{ ext.name }}:
Andy Bavier75e17122017-07-26 09:07:19 -0700304 image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400305 networks:
306{% for network in xos_docker_networks %}
307 - {{ network }}
308{% endfor %}
309 command: npm run build
310 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700311 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400312 logging:
313 driver: "json-file"
314 options:
315 max-size: "1000k"
316 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700317 depends_on:
318 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400319{% endfor %}
320
321{% if not frontend_only %}
322{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700323{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400324 {{ svc.name }}-synchronizer:
Andy Bavier75e17122017-07-26 09:07:19 -0700325 image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400326 networks:
327{% for network in xos_docker_networks %}
328 - {{ network }}
329{% endfor %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400330 depends_on:
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700331 - registrator
332{% if use_redis %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400333 - xos_redis
334{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700335 links:
336 - consul:consul
337{% if use_redis %}
338 - xos_redis:redis
339{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400340 volumes:
Zack Williams9cea13e2017-07-25 16:32:59 -0700341 - {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700342 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
Zack Williams79286962017-07-10 12:24:37 -0700343 - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700344 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400345{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700346 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400347{% endif %}
348{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700349 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400350{% endif %}
351 logging:
352 driver: "json-file"
353 options:
354 max-size: "1000k"
355 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700356 environment:
357 SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400358 restart: unless-stopped
359
360{% endif %}
361{% endfor %}
362{% endif %}