blob: 09f8fd385014734599bf29cc05f8df7156dde338 [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 %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040042 xos_db:
Andy Bavier75e17122017-07-26 09:07:19 -070043 image: {{ pull_docker_registry }}xosproject/xos-postgres:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040044 networks:
45{% for network in xos_docker_networks %}
46 - {{ network }}
47{% endfor %}
48 expose:
49 - "5432"
50 restart: unless-stopped
51
52{% if use_redis %}
53 xos_redis:
Andy Bavier75e17122017-07-26 09:07:19 -070054 image: {{ pull_docker_registry }}redis:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040055 networks:
56{% for network in xos_docker_networks %}
57 - {{ network }}
58{% endfor %}
59 logging:
60 driver: "json-file"
61 options:
62 max-size: "1000k"
63 max-file: "5"
64 restart: unless-stopped
65{% endif %}
66
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070067 xos_gui:
Andy Bavier75e17122017-07-26 09:07:19 -070068 image: {{ pull_docker_registry }}xosproject/xos-gui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040069 networks:
70{% for network in xos_docker_networks %}
71 - {{ network }}
72{% endfor %}
73 ports:
74 - "4000:4000"
75 links:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070076 - xos_ws:xos-ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040077 - xos_chameleon:xos-chameleon
78 depends_on:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070079 - xos_ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040080 - xos_chameleon
81 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -070082 - {{ head_cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js
83 - {{ head_cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js
Andy Bavier9e7d54a2017-04-17 11:37:02 -040084 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070085 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -040086 logging:
87 driver: "json-file"
88 options:
89 max-size: "1000k"
90 max-file: "5"
91 restart: unless-stopped
92
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -070093 xos_tosca:
Andy Bavier75e17122017-07-26 09:07:19 -070094 image: {{ pull_docker_registry }}xosproject/xos-tosca:{{ pull_docker_tag }}
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -070095 networks:
96{% for network in xos_docker_networks %}
97 - {{ network }}
98{% endfor %}
99 ports:
100 - "9102:9102"
101 links:
102 - xos_core:xos-core
103 volumes:
104 - {{ head_cord_profile_dir }}/xos-tosca.config.yaml:/opt/xos-tosca/src/xos-tosca.config.yaml
Matteo Scandolo9b5e6682017-09-13 08:51:20 -0700105 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700106 depends_on:
107 - xos_core
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700108 logging:
109 driver: "json-file"
110 options:
111 max-size: "1000k"
112 max-file: "5"
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700113 restart: unless-stopped
114
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400115 xos_chameleon:
Andy Bavier75e17122017-07-26 09:07:19 -0700116 image: {{ pull_docker_registry }}xosproject/chameleon:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400117 networks:
118{% for network in xos_docker_networks %}
119 - {{ network }}
120{% endfor %}
Scott Baker02a529f2018-02-20 15:12:11 -0800121 command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs -r
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400122 ports:
123 - "9101:9101"
124 links:
125 - xos_core:xos-core
126 depends_on:
127 - xos_core
128 logging:
129 driver: "json-file"
130 options:
131 max-size: "1000k"
132 max-file: "5"
133 restart: unless-stopped
134
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700135 gui_extensions_store:
Andy Bavierd2cab422017-07-24 16:38:24 -0700136 image: {{ pull_docker_registry }}node:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400137 networks:
138{% for network in xos_docker_networks %}
139 - {{ network }}
140{% endfor %}
141 command: /bin/true
142 volumes:
143 - /var/www/dist/extensions
144 logging:
145 driver: "json-file"
146 options:
147 max-size: "1000k"
148 max-file: "5"
149
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700150 xos_ws:
Andy Bavier75e17122017-07-26 09:07:19 -0700151 image: {{ pull_docker_registry }}xosproject/xos-ws:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400152 networks:
153{% for network in xos_docker_networks %}
154 - {{ network }}
155{% endfor %}
156 command: npm start -- --config gateway-config.yml
157 ports:
158 - "3000:3000"
159 links:
Matteo Scandolodd5fc6a2018-01-19 16:41:52 -0800160 - xos_core:xos
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400161{% if use_redis %}
162 - xos_redis:redis
163{% endif %}
164 depends_on:
Matteo Scandolodd5fc6a2018-01-19 16:41:52 -0800165 - xos_core
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400166{% if use_redis %}
167 - xos_redis
168{% endif %}
169 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700170 - {{ head_cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400171 logging:
172 driver: "json-file"
173 options:
174 max-size: "1000k"
175 max-file: "5"
176 restart: unless-stopped
177
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400178 xos_core:
Andy Bavier75e17122017-07-26 09:07:19 -0700179 image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400180 networks:
181{% for network in xos_docker_networks %}
182 - {{ network }}
183{% endfor %}
Sapan Bhatia17b48f92018-01-03 12:42:50 -0500184 command: bash -c "service filebeat start; cd coreapi; bash ./start_coreapi.sh"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400185 ports:
186 - "50051:50051"
187 - "50055:50055"
188 links:
Gopinath Taget4c13da62018-01-19 16:13:19 -0800189 - xos_db:xos-db
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400190{% if use_redis %}
191 - xos_redis:redis
192{% endif %}
193 depends_on:
194 - xos_db
195{% if use_redis %}
196 - xos_redis
197{% endif %}
198 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700199 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
Scott Bakerd69223c2018-02-27 11:31:26 -0800200 - {{ head_cord_profile_dir }}/core_api_cert.pem:/opt/cord_profile/core_api_cert.pem:ro
201 - {{ head_cord_profile_dir }}/core_api_key.pem:/opt/cord_profile/core_api_key.pem:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700202 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Matteo Scandolob92469d2017-07-28 17:32:00 -0700203 - {{ head_cord_profile_dir }}/initial_data.yaml:/opt/xos/core/migrations/initial_data.yaml:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400204 logging:
205 driver: "json-file"
206 options:
207 max-size: "1000k"
208 max-file: "5"
209 restart: unless-stopped
210
211{% for ext in enabled_gui_extensions %}
212 gui-extension-{{ ext.name }}:
Andy Bavier75e17122017-07-26 09:07:19 -0700213 image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400214 networks:
215{% for network in xos_docker_networks %}
216 - {{ network }}
217{% endfor %}
Matteo Scandolo31634f22017-11-16 10:30:11 -0800218 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 -0400219 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700220 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400221 logging:
222 driver: "json-file"
223 options:
224 max-size: "1000k"
225 max-file: "5"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400226{% endfor %}
227
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400228{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700229{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400230 {{ svc.name }}-synchronizer:
Andy Bavier75e17122017-07-26 09:07:19 -0700231 image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400232 networks:
233{% for network in xos_docker_networks %}
234 - {{ network }}
235{% endfor %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700236{% if use_redis %}
Matteo Scandolo705f7e92018-02-09 16:27:29 -0800237 depends_on:
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400238 - xos_redis
239{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700240 links:
Matteo Scandolodf7a6a72018-01-11 16:09:38 -0800241 - xos_core:xos-core
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700242{% if use_redis %}
243 - xos_redis:redis
244{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400245 volumes:
Zack Williams9cea13e2017-07-25 16:32:59 -0700246 - {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700247 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
Zack Williams79286962017-07-10 12:24:37 -0700248 - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700249 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400250{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700251 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400252{% endif %}
253{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700254 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400255{% endif %}
256 logging:
257 driver: "json-file"
258 options:
259 max-size: "1000k"
260 max-file: "5"
Scott Baker719d7452018-01-23 15:55:32 -0800261 restart: on-failure
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400262
263{% endif %}
264{% endfor %}