blob: a6e21b3dcfce63c0fdc6619c21b4a42a2772499f [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 Scandoloc111b442017-08-24 13:27:34 -0700234 command: python /opt/xos/manage.py runserver 0.0.0.0:9000
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
Zack Williamsc989f262017-05-11 13:02:59 -0700251 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400252 logging:
253 driver: "json-file"
254 options:
255 max-size: "1000k"
256 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700257 depends_on:
258 - registrator
259 environment:
260 SERVICE_9000_NAME: "xos-ui-deprecated"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400261 restart: unless-stopped
262
263 xos_core:
Andy Bavier75e17122017-07-26 09:07:19 -0700264 image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400265 networks:
266{% for network in xos_docker_networks %}
267 - {{ network }}
268{% endfor %}
269 command: bash -c "cd coreapi; bash ./start_coreapi.sh"
270 ports:
271 - "50051:50051"
272 - "50055:50055"
273 links:
274 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700275 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400276{% if use_redis %}
277 - xos_redis:redis
278{% endif %}
279 depends_on:
280 - xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700281 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400282{% if use_redis %}
283 - xos_redis
284{% endif %}
285 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700286 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
287 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700288 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandolob92469d2017-07-28 17:32:00 -0700289 - {{ head_cord_profile_dir }}/initial_data.yaml:/opt/xos/core/migrations/initial_data.yaml:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400290 - /var/run/docker.sock:/var/run/docker.sock
291 logging:
292 driver: "json-file"
293 options:
294 max-size: "1000k"
295 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700296 environment:
297 SERVICE_50051_NAME: "xos-grpc-secure"
298 SERVICE_50055_NAME: "xos-grpc-insecure"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400299 restart: unless-stopped
300
301{% for ext in enabled_gui_extensions %}
302 gui-extension-{{ ext.name }}:
Andy Bavier75e17122017-07-26 09:07:19 -0700303 image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400304 networks:
305{% for network in xos_docker_networks %}
306 - {{ network }}
307{% endfor %}
308 command: npm run build
309 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700310 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400311 logging:
312 driver: "json-file"
313 options:
314 max-size: "1000k"
315 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700316 depends_on:
317 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400318{% endfor %}
319
320{% if not frontend_only %}
321{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700322{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400323 {{ svc.name }}-synchronizer:
Andy Bavier75e17122017-07-26 09:07:19 -0700324 image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400325 networks:
326{% for network in xos_docker_networks %}
327 - {{ network }}
328{% endfor %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400329 depends_on:
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700330 - registrator
331{% if use_redis %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400332 - xos_redis
333{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700334 links:
335 - consul:consul
336{% if use_redis %}
337 - xos_redis:redis
338{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400339 volumes:
Zack Williams9cea13e2017-07-25 16:32:59 -0700340 - {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700341 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
Zack Williams79286962017-07-10 12:24:37 -0700342 - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700343 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400344{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700345 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400346{% endif %}
347{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700348 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400349{% endif %}
350 logging:
351 driver: "json-file"
352 options:
353 max-size: "1000k"
354 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700355 environment:
356 SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400357 restart: unless-stopped
358
359{% endif %}
360{% endfor %}
361{% endif %}