blob: a3f817b0e30cf451314570d7d73e26a812fb7cb5 [file] [log] [blame]
Zack Williamsa39dba02018-04-02 13:36:56 -07001---
Matteo Scandolo3896c472017-08-01 13:31:42 -07002{#
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
Andy Bavier9e7d54a2017-04-17 11:37:02 -040018version: '2'
19
20# XOS docker compose
Zack Williamsc989f262017-05-11 13:02:59 -070021# generated by cord-profile/templates/docker-compose.yml.j2
Andy Bavier9e7d54a2017-04-17 11:37:02 -040022
23networks:
24{% for network in xos_docker_networks %}
25 {{ network }}:
26 external: true
27{% endfor %}
28
29services:
Varun Belur86764532017-09-08 18:39:58 -060030{% if use_elasticstack %}
31 elk:
32 image: {{ pull_docker_registry }}sebp/elk:{{ pull_docker_tag }}
33 ports:
34 - "5601:5601"
35 - "9200:9200"
36 networks:
37{% for network in xos_docker_networks %}
38 - {{ network }}
Zack Williamsa39dba02018-04-02 13:36:56 -070039{% endfor %}
Varun Belur86764532017-09-08 18:39:58 -060040{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040041 xos_db:
Zack Williamsa39dba02018-04-02 13:36:56 -070042 image: {{ pull_docker_registry }}postgres:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040043 networks:
44{% for network in xos_docker_networks %}
45 - {{ network }}
46{% endfor %}
Zack Williamsa39dba02018-04-02 13:36:56 -070047 environment:
48 - POSTGRES_DB={{ xos_db_name }}
49 - POSTGRES_USER={{ xos_db_username }}
50 - POSTGRES_PASSWORD={{ xos_db_password }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040051 expose:
52 - "5432"
53 restart: unless-stopped
54
55{% if use_redis %}
56 xos_redis:
Andy Bavier75e17122017-07-26 09:07:19 -070057 image: {{ pull_docker_registry }}redis:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040058 networks:
59{% for network in xos_docker_networks %}
60 - {{ network }}
61{% endfor %}
62 logging:
63 driver: "json-file"
64 options:
65 max-size: "1000k"
66 max-file: "5"
67 restart: unless-stopped
68{% endif %}
69
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070070 xos_gui:
Andy Bavier75e17122017-07-26 09:07:19 -070071 image: {{ pull_docker_registry }}xosproject/xos-gui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040072 networks:
73{% for network in xos_docker_networks %}
74 - {{ network }}
75{% endfor %}
76 ports:
77 - "4000:4000"
78 links:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070079 - xos_ws:xos-ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040080 - xos_chameleon:xos-chameleon
81 depends_on:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070082 - xos_ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040083 - xos_chameleon
84 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -070085 - {{ head_cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js
86 - {{ head_cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js
Andy Bavier9e7d54a2017-04-17 11:37:02 -040087 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070088 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -040089 logging:
90 driver: "json-file"
91 options:
92 max-size: "1000k"
93 max-file: "5"
94 restart: unless-stopped
95
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -070096 xos_tosca:
Andy Bavier75e17122017-07-26 09:07:19 -070097 image: {{ pull_docker_registry }}xosproject/xos-tosca:{{ pull_docker_tag }}
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -070098 networks:
99{% for network in xos_docker_networks %}
100 - {{ network }}
101{% endfor %}
102 ports:
103 - "9102:9102"
104 links:
105 - xos_core:xos-core
106 volumes:
107 - {{ head_cord_profile_dir }}/xos-tosca.config.yaml:/opt/xos-tosca/src/xos-tosca.config.yaml
Matteo Scandolo9b5e6682017-09-13 08:51:20 -0700108 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700109 depends_on:
110 - xos_core
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700111 logging:
112 driver: "json-file"
113 options:
114 max-size: "1000k"
115 max-file: "5"
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700116 restart: unless-stopped
117
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400118 xos_chameleon:
Andy Bavier75e17122017-07-26 09:07:19 -0700119 image: {{ pull_docker_registry }}xosproject/chameleon:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400120 networks:
121{% for network in xos_docker_networks %}
122 - {{ network }}
123{% endfor %}
Scott Baker02a529f2018-02-20 15:12:11 -0800124 command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs -r
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400125 ports:
126 - "9101:9101"
127 links:
128 - xos_core:xos-core
129 depends_on:
130 - xos_core
131 logging:
132 driver: "json-file"
133 options:
134 max-size: "1000k"
135 max-file: "5"
136 restart: unless-stopped
137
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700138 gui_extensions_store:
Andy Bavierd2cab422017-07-24 16:38:24 -0700139 image: {{ pull_docker_registry }}node:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400140 networks:
141{% for network in xos_docker_networks %}
142 - {{ network }}
143{% endfor %}
144 command: /bin/true
145 volumes:
146 - /var/www/dist/extensions
147 logging:
148 driver: "json-file"
149 options:
150 max-size: "1000k"
151 max-file: "5"
152
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700153 xos_ws:
Andy Bavier75e17122017-07-26 09:07:19 -0700154 image: {{ pull_docker_registry }}xosproject/xos-ws:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400155 networks:
156{% for network in xos_docker_networks %}
157 - {{ network }}
158{% endfor %}
159 command: npm start -- --config gateway-config.yml
160 ports:
161 - "3000:3000"
162 links:
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400163{% if use_redis %}
164 - xos_redis:redis
165{% endif %}
166 depends_on:
Matteo Scandolodd5fc6a2018-01-19 16:41:52 -0800167 - xos_core
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400168{% if use_redis %}
169 - xos_redis
170{% endif %}
171 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700172 - {{ head_cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400173 logging:
174 driver: "json-file"
175 options:
176 max-size: "1000k"
177 max-file: "5"
178 restart: unless-stopped
179
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400180 xos_core:
Scott Bakere8fcb1c2018-03-29 15:31:03 -0700181 image: {{ pull_docker_registry }}xosproject/xos-core:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400182 networks:
183{% for network in xos_docker_networks %}
184 - {{ network }}
185{% endfor %}
Sapan Bhatia17b48f92018-01-03 12:42:50 -0500186 command: bash -c "service filebeat start; cd coreapi; bash ./start_coreapi.sh"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400187 ports:
188 - "50051:50051"
189 - "50055:50055"
190 links:
Gopinath Taget4c13da62018-01-19 16:13:19 -0800191 - xos_db:xos-db
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400192{% if use_redis %}
193 - xos_redis:redis
194{% endif %}
195 depends_on:
196 - xos_db
197{% if use_redis %}
198 - xos_redis
199{% endif %}
200 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700201 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
Scott Bakerd69223c2018-02-27 11:31:26 -0800202 - {{ head_cord_profile_dir }}/core_api_cert.pem:/opt/cord_profile/core_api_cert.pem:ro
203 - {{ head_cord_profile_dir }}/core_api_key.pem:/opt/cord_profile/core_api_key.pem:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700204 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandolob92469d2017-07-28 17:32:00 -0700205 - {{ head_cord_profile_dir }}/initial_data.yaml:/opt/xos/core/migrations/initial_data.yaml:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400206 logging:
207 driver: "json-file"
208 options:
209 max-size: "1000k"
210 max-file: "5"
211 restart: unless-stopped
212
213{% for ext in enabled_gui_extensions %}
214 gui-extension-{{ ext.name }}:
Andy Bavier75e17122017-07-26 09:07:19 -0700215 image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400216 networks:
217{% for network in xos_docker_networks %}
218 - {{ network }}
219{% endfor %}
Matteo Scandolo31634f22017-11-16 10:30:11 -0800220 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 -0400221 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700222 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400223 logging:
224 driver: "json-file"
225 options:
226 max-size: "1000k"
227 max-file: "5"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400228{% endfor %}
229
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400230{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700231{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400232 {{ svc.name }}-synchronizer:
Andy Bavier75e17122017-07-26 09:07:19 -0700233 image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400234 networks:
235{% for network in xos_docker_networks %}
236 - {{ network }}
237{% endfor %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700238{% if use_redis %}
Matteo Scandolo705f7e92018-02-09 16:27:29 -0800239 depends_on:
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400240 - xos_redis
241{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700242 links:
Matteo Scandolodf7a6a72018-01-11 16:09:38 -0800243 - xos_core:xos-core
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700244{% if use_redis %}
245 - xos_redis:redis
246{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400247 volumes:
Zack Williams9cea13e2017-07-25 16:32:59 -0700248 - {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700249 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
Zack Williams79286962017-07-10 12:24:37 -0700250 - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials: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{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700253 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400254{% endif %}
255{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700256 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400257{% endif %}
258 logging:
259 driver: "json-file"
260 options:
261 max-size: "1000k"
262 max-file: "5"
Scott Baker719d7452018-01-23 15:55:32 -0800263 restart: on-failure
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400264
265{% endif %}
266{% endfor %}