blob: 57cc3fed3b4d446b1cc0c9933c8eb09d8591f3b4 [file] [log] [blame]
Andy Bavier9e7d54a2017-04-17 11:37:02 -04001version: '2'
2
3# XOS docker compose
Zack Williamsc989f262017-05-11 13:02:59 -07004# generated by cord-profile/templates/docker-compose.yml.j2
Andy Bavier9e7d54a2017-04-17 11:37:02 -04005
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:
Andy Bavier75e17122017-07-26 09:07:19 -070014 image: {{ pull_docker_registry }}gliderlabs/consul-server:{{ pull_docker_tag }}
Matteo Scandolo893b3d52017-05-18 16:59:53 -070015 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:
Matteo Scandolo602dd3e2017-05-25 22:36:15 -070023 SERVICE_8300_IGNORE: "yes"
24 SERVICE_8301_IGNORE: "yes"
25 SERVICE_8302_IGNORE: "yes"
26 SERVICE_8400_IGNORE: "yes"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070027 SERVICE_8500_NAME: "consul-rest"
Matteo Scandolo602dd3e2017-05-25 22:36:15 -070028 SERVICE_8600_IGNORE: "yes"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070029 restart: unless-stopped
30 registrator:
Andy Bavier75e17122017-07-26 09:07:19 -070031 image: {{ pull_docker_registry }}gliderlabs/registrator:{{ pull_docker_tag }}
Matteo Scandolo893b3d52017-05-18 16:59:53 -070032 command: [
33 "-ip=${DOCKER_HOST_IP}",
Matteo Scandolo602dd3e2017-05-25 22:36:15 -070034 "-internal",
Matteo Scandolo893b3d52017-05-18 16:59:53 -070035 "-retry-attempts", "100",
36 "consul://consul:8500"
37 ]
38 networks:
39{% for network in xos_docker_networks %}
40 - {{ network }}
41{% endfor %}
42 links:
43 - consul
44 volumes:
45 - /var/run/docker.sock:/tmp/docker.sock
46 depends_on:
47 - consul
48 restart: unless-stopped
Andy Bavier9e7d54a2017-04-17 11:37:02 -040049 xos_db:
Andy Bavier75e17122017-07-26 09:07:19 -070050 image: {{ pull_docker_registry }}xosproject/xos-postgres:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040051 networks:
52{% for network in xos_docker_networks %}
53 - {{ network }}
54{% endfor %}
55 expose:
56 - "5432"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070057 depends_on:
58 - registrator
59 environment:
60 SERVICE_5432_NAME: "xos-db"
Andy Bavier9e7d54a2017-04-17 11:37:02 -040061 restart: unless-stopped
62
63{% if use_redis %}
64 xos_redis:
Andy Bavier75e17122017-07-26 09:07:19 -070065 image: {{ pull_docker_registry }}redis:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040066 networks:
67{% for network in xos_docker_networks %}
68 - {{ network }}
69{% endfor %}
70 logging:
71 driver: "json-file"
72 options:
73 max-size: "1000k"
74 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -070075 depends_on:
76 - registrator
77 environment:
78 SERVICE_NAME: "redis"
Andy Bavier9e7d54a2017-04-17 11:37:02 -040079 restart: unless-stopped
80{% endif %}
81
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070082 xos_gui:
Andy Bavier75e17122017-07-26 09:07:19 -070083 image: {{ pull_docker_registry }}xosproject/xos-gui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -040084 networks:
85{% for network in xos_docker_networks %}
86 - {{ network }}
87{% endfor %}
88 ports:
89 - "4000:4000"
90 links:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070091 - xos_ws:xos-ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040092 - xos_chameleon:xos-chameleon
93 depends_on:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070094 - xos_ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040095 - xos_chameleon
96 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -070097 - {{ head_cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js
98 - {{ head_cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js
Andy Bavier9e7d54a2017-04-17 11:37:02 -040099 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700100 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400101 logging:
102 driver: "json-file"
103 options:
104 max-size: "1000k"
105 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700106 depends_on:
107 - registrator
108 environment:
109 SERVICE_4000_NAME: "xos-gui"
Matteo Scandolo602dd3e2017-05-25 22:36:15 -0700110 SERVICE_80_IGNORE: "yes"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400111 restart: unless-stopped
112
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700113 xos_tosca:
Andy Bavier75e17122017-07-26 09:07:19 -0700114 image: {{ pull_docker_registry }}xosproject/xos-tosca:{{ pull_docker_tag }}
Matteo Scandoloc4f2c5f2017-07-12 16:25:08 -0700115 networks:
116{% for network in xos_docker_networks %}
117 - {{ network }}
118{% endfor %}
119 ports:
120 - "9102:9102"
121 links:
122 - xos_core:xos-core
123 volumes:
124 - {{ head_cord_profile_dir }}/xos-tosca.config.yaml:/opt/xos-tosca/src/xos-tosca.config.yaml
125 depends_on:
126 - xos_core
127 - registrator
128 logging:
129 driver: "json-file"
130 options:
131 max-size: "1000k"
132 max-file: "5"
133 environment:
134 SERVICE_9102_NAME: "xos-tosca"
135 restart: unless-stopped
136
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400137 xos_chameleon:
Andy Bavier75e17122017-07-26 09:07:19 -0700138 image: {{ pull_docker_registry }}xosproject/chameleon:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400139 networks:
140{% for network in xos_docker_networks %}
141 - {{ network }}
142{% endfor %}
Matteo Scandolo7023aa22017-05-09 11:34:52 -0700143 command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400144 ports:
145 - "9101:9101"
146 links:
147 - xos_core:xos-core
148 depends_on:
149 - xos_core
150 logging:
151 driver: "json-file"
152 options:
153 max-size: "1000k"
154 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700155 depends_on:
156 - registrator
157 environment:
158 SERVICE_9101_NAME: "xos-rest"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400159 restart: unless-stopped
160
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700161 gui_extensions_store:
Andy Bavier75e17122017-07-26 09:07:19 -0700162 image: {{ pull_docker_registry }}node:7.9.0
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400163 networks:
164{% for network in xos_docker_networks %}
165 - {{ network }}
166{% endfor %}
167 command: /bin/true
168 volumes:
169 - /var/www/dist/extensions
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
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400177
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700178 xos_ws:
Andy Bavier75e17122017-07-26 09:07:19 -0700179 image: {{ pull_docker_registry }}xosproject/xos-ws:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400180 networks:
181{% for network in xos_docker_networks %}
182 - {{ network }}
183{% endfor %}
184 command: npm start -- --config gateway-config.yml
185 ports:
186 - "3000:3000"
187 links:
188 - xos_ui:xos
189{% if use_redis %}
190 - xos_redis:redis
191{% endif %}
192 depends_on:
193 - xos_ui
194{% if use_redis %}
195 - xos_redis
196{% endif %}
197 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700198 - {{ head_cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400199 logging:
200 driver: "json-file"
201 options:
202 max-size: "1000k"
203 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700204 depends_on:
205 - registrator
206 environment:
207 SERVICE_3000_NAME: "xos-ws"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400208 restart: unless-stopped
209
210 xos_ui:
Andy Bavier75e17122017-07-26 09:07:19 -0700211 image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400212 networks:
213{% for network in xos_docker_networks %}
214 - {{ network }}
215{% endfor %}
216 command: python /opt/xos/manage.py runserver 0.0.0.0:9000 --insecure --makemigrations
217 ports:
218 - "9000:9000"
219 links:
220 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700221 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400222{% if use_redis %}
223 - xos_redis:redis
224{% endif %}
225 depends_on:
226 - xos_db
227{% if use_redis %}
228 - xos_redis
229{% endif %}
230 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700231 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
232 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
233 - {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
234 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400235 logging:
236 driver: "json-file"
237 options:
238 max-size: "1000k"
239 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700240 depends_on:
241 - registrator
242 environment:
243 SERVICE_9000_NAME: "xos-ui-deprecated"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400244 restart: unless-stopped
245
246 xos_core:
Andy Bavier75e17122017-07-26 09:07:19 -0700247 image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400248 networks:
249{% for network in xos_docker_networks %}
250 - {{ network }}
251{% endfor %}
252 command: bash -c "cd coreapi; bash ./start_coreapi.sh"
253 ports:
254 - "50051:50051"
255 - "50055:50055"
256 links:
257 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700258 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400259{% if use_redis %}
260 - xos_redis:redis
261{% endif %}
262 depends_on:
263 - xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700264 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400265{% if use_redis %}
266 - xos_redis
267{% endif %}
268 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700269 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
270 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
271 - {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
272 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400273 - /var/run/docker.sock:/var/run/docker.sock
274 logging:
275 driver: "json-file"
276 options:
277 max-size: "1000k"
278 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700279 environment:
280 SERVICE_50051_NAME: "xos-grpc-secure"
281 SERVICE_50055_NAME: "xos-grpc-insecure"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400282 restart: unless-stopped
283
284{% for ext in enabled_gui_extensions %}
285 gui-extension-{{ ext.name }}:
Andy Bavier75e17122017-07-26 09:07:19 -0700286 image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400287 networks:
288{% for network in xos_docker_networks %}
289 - {{ network }}
290{% endfor %}
291 command: npm run build
292 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700293 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400294 logging:
295 driver: "json-file"
296 options:
297 max-size: "1000k"
298 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700299 depends_on:
300 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400301{% endfor %}
302
303{% if not frontend_only %}
304{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700305{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400306 {{ svc.name }}-synchronizer:
Andy Bavier75e17122017-07-26 09:07:19 -0700307 image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400308 networks:
309{% for network in xos_docker_networks %}
310 - {{ network }}
311{% endfor %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400312 depends_on:
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700313 - registrator
314{% if use_redis %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400315 - xos_redis
316{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700317 links:
318 - consul:consul
319{% if use_redis %}
320 - xos_redis:redis
321{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400322 volumes:
Zack Williams9cea13e2017-07-25 16:32:59 -0700323 - {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700324 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
Zack Williams79286962017-07-10 12:24:37 -0700325 - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro
Zack Williamsc989f262017-05-11 13:02:59 -0700326 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400327{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700328 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400329{% endif %}
330{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700331 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400332{% endif %}
333 logging:
334 driver: "json-file"
335 options:
336 max-size: "1000k"
337 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700338 environment:
339 SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400340 restart: unless-stopped
341
342{% endif %}
343{% endfor %}
344{% endif %}