blob: 2a9437ff6f5a970b1dffdf44b26e2142f5ac4b71 [file] [log] [blame]
Andy Bavier9e7d54a2017-04-17 11:37:02 -04001version: '2'
2
3# XOS docker compose
4# generated by platform-install/roles/cord-profile
5
6networks:
7{% for network in xos_docker_networks %}
8 {{ network }}:
9 external: true
10{% endfor %}
11
12services:
Matteo Scandolo893b3d52017-05-18 16:59:53 -070013 consul:
14 image: {{ deploy_docker_registry }}gliderlabs/consul-server:{{ deploy_docker_tag }}
15 command: "-advertise=${MYHOST} -server -bootstrap"
16 ports:
17 - "127.0.0.1:8500:8500"
18 networks:
19{% for network in xos_docker_networks %}
20 - {{ network }}
21{% endfor %}
22 environment:
23 SERVICE_8500_NAME: "consul-rest"
24 restart: unless-stopped
25 registrator:
26 image: {{ deploy_docker_registry }}gliderlabs/registrator:{{ deploy_docker_tag }}
27 command: [
28 "-ip=${DOCKER_HOST_IP}",
29 "-retry-attempts", "100",
30 "consul://consul:8500"
31 ]
32 networks:
33{% for network in xos_docker_networks %}
34 - {{ network }}
35{% endfor %}
36 links:
37 - consul
38 volumes:
39 - /var/run/docker.sock:/tmp/docker.sock
40 depends_on:
41 - consul
42 restart: unless-stopped
Andy Bavier9e7d54a2017-04-17 11:37:02 -040043 xos_db:
44 image: {{ deploy_docker_registry }}xosproject/xos-postgres:{{ deploy_docker_tag }}
45 networks:
46{% for network in xos_docker_networks %}
47 - {{ network }}
48{% endfor %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -070049 ports:
50 - "5432:5432"
Andy Bavier9e7d54a2017-04-17 11:37:02 -040051 expose:
52 - "5432"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070053 depends_on:
54 - registrator
55 environment:
56 SERVICE_5432_NAME: "xos-db"
Andy Bavier9e7d54a2017-04-17 11:37:02 -040057 restart: unless-stopped
58
59{% if use_redis %}
60 xos_redis:
61 image: {{ deploy_docker_registry }}redis:{{ deploy_docker_tag }}
62 networks:
63{% for network in xos_docker_networks %}
64 - {{ network }}
65{% endfor %}
66 logging:
67 driver: "json-file"
68 options:
69 max-size: "1000k"
70 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070071 depends_on:
72 - registrator
73 environment:
74 SERVICE_NAME: "redis"
Andy Bavier9e7d54a2017-04-17 11:37:02 -040075 restart: unless-stopped
76{% endif %}
77
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070078 xos_gui:
Andy Bavier9e7d54a2017-04-17 11:37:02 -040079 image: {{ deploy_docker_registry }}xosproject/xos-gui:{{ deploy_docker_tag }}
80 networks:
81{% for network in xos_docker_networks %}
82 - {{ network }}
83{% endfor %}
84 ports:
85 - "4000:4000"
86 links:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070087 - xos_ws:xos-ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040088 - xos_chameleon:xos-chameleon
89 depends_on:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070090 - xos_ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040091 - xos_chameleon
92 volumes:
93 - {{ cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js
94 - {{ cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js
95 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070096 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -040097 logging:
98 driver: "json-file"
99 options:
100 max-size: "1000k"
101 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700102 depends_on:
103 - registrator
104 environment:
105 SERVICE_4000_NAME: "xos-gui"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400106 restart: unless-stopped
107
108 xos_chameleon:
109 image: {{ deploy_docker_registry }}xosproject/chameleon:{{ deploy_docker_tag }}
110 networks:
111{% for network in xos_docker_networks %}
112 - {{ network }}
113{% endfor %}
Matteo Scandolo7023aa22017-05-09 11:34:52 -0700114 command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400115 ports:
116 - "9101:9101"
117 links:
118 - xos_core:xos-core
119 depends_on:
120 - xos_core
121 logging:
122 driver: "json-file"
123 options:
124 max-size: "1000k"
125 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700126 depends_on:
127 - registrator
128 environment:
129 SERVICE_9101_NAME: "xos-rest"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400130 restart: unless-stopped
131
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700132 gui_extensions_store:
Matteo Scandolo05366452017-05-09 15:09:04 -0700133 image: {{ deploy_docker_registry }}node:7.9.0
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400134 networks:
135{% for network in xos_docker_networks %}
136 - {{ network }}
137{% endfor %}
138 command: /bin/true
139 volumes:
140 - /var/www/dist/extensions
141 logging:
142 driver: "json-file"
143 options:
144 max-size: "1000k"
145 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700146 depends_on:
147 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400148
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700149 xos_ws:
150 image: {{ deploy_docker_registry }}xosproject/xos-ws:{{ deploy_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400151 networks:
152{% for network in xos_docker_networks %}
153 - {{ network }}
154{% endfor %}
155 command: npm start -- --config gateway-config.yml
156 ports:
157 - "3000:3000"
158 links:
159 - xos_ui:xos
160{% if use_redis %}
161 - xos_redis:redis
162{% endif %}
163 depends_on:
164 - xos_ui
165{% if use_redis %}
166 - xos_redis
167{% endif %}
168 volumes:
169 - {{ cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
170 logging:
171 driver: "json-file"
172 options:
173 max-size: "1000k"
174 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700175 depends_on:
176 - registrator
177 environment:
178 SERVICE_3000_NAME: "xos-ws"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400179 restart: unless-stopped
180
181 xos_ui:
182 image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }}
183 networks:
184{% for network in xos_docker_networks %}
185 - {{ network }}
186{% endfor %}
187 command: python /opt/xos/manage.py runserver 0.0.0.0:9000 --insecure --makemigrations
188 ports:
189 - "9000:9000"
190 links:
191 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700192 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400193{% if use_redis %}
194 - xos_redis:redis
195{% endif %}
196 depends_on:
197 - xos_db
198{% if use_redis %}
199 - xos_redis
200{% endif %}
201 volumes:
202 - {{ cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
203 - {{ cord_profile_dir }}:/opt/cord_profile:ro
204 - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
205 - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
206 logging:
207 driver: "json-file"
208 options:
209 max-size: "1000k"
210 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700211 depends_on:
212 - registrator
213 environment:
214 SERVICE_9000_NAME: "xos-ui-deprecated"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400215 restart: unless-stopped
216
217 xos_core:
218 image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }}
219 networks:
220{% for network in xos_docker_networks %}
221 - {{ network }}
222{% endfor %}
223 command: bash -c "cd coreapi; bash ./start_coreapi.sh"
224 ports:
225 - "50051:50051"
226 - "50055:50055"
227 links:
228 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700229 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400230{% if use_redis %}
231 - xos_redis:redis
232{% endif %}
233 depends_on:
234 - xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700235 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400236{% if use_redis %}
237 - xos_redis
238{% endif %}
239 volumes:
240 - {{ cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
241 - {{ cord_profile_dir }}:/opt/cord_profile:ro
242 - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
243 - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
244 - /var/run/docker.sock:/var/run/docker.sock
245 logging:
246 driver: "json-file"
247 options:
248 max-size: "1000k"
249 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700250 environment:
251 SERVICE_50051_NAME: "xos-grpc-secure"
252 SERVICE_50055_NAME: "xos-grpc-insecure"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400253 restart: unless-stopped
254
255{% for ext in enabled_gui_extensions %}
256 gui-extension-{{ ext.name }}:
257 image: {{ deploy_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ deploy_docker_tag }}
258 networks:
259{% for network in xos_docker_networks %}
260 - {{ network }}
261{% endfor %}
262 command: npm run build
263 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700264 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400265 logging:
266 driver: "json-file"
267 options:
268 max-size: "1000k"
269 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700270 depends_on:
271 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400272{% endfor %}
273
274{% if not frontend_only %}
275{% for svc in xos_services %}
276{% if svc.synchronizer is defined and svc.synchronizer %}
277 {{ svc.name }}-synchronizer:
278 image: {{ deploy_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ deploy_docker_tag }}
279 networks:
280{% for network in xos_docker_networks %}
281 - {{ network }}
282{% endfor %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400283 depends_on:
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700284 - registrator
285{% if use_redis %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400286 - xos_redis
287{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700288 links:
289 - consul:consul
290{% if use_redis %}
291 - xos_redis:redis
292{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400293 volumes:
294 - {{ cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
295 - {{ cord_dir }}/build/platform-install/credentials/xosadmin@opencord.org:/opt/xos/services/{{ svc.name }}/credentials/xosadmin@opencord.org:ro
296 - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
297{% if svc.keypair is defined %}
298 - {{ cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
299{% endif %}
300{% if svc.name == "openstack" %}
301 - {{ cord_profile_dir }}/images:/opt/xos/images:ro
302{% endif %}
303 logging:
304 driver: "json-file"
305 options:
306 max-size: "1000k"
307 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700308 environment:
309 SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400310 restart: unless-stopped
311
312{% endif %}
313{% endfor %}
314{% endif %}