blob: fe1616183746e7c615e540c15886dabb622ebc7f [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:
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:
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:
31 image: {{ deploy_docker_registry }}gliderlabs/registrator:{{ deploy_docker_tag }}
32 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:
50 image: {{ deploy_docker_registry }}xosproject/xos-postgres:{{ deploy_docker_tag }}
51 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:
65 image: {{ deploy_docker_registry }}redis:{{ deploy_docker_tag }}
66 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 Bavier9e7d54a2017-04-17 11:37:02 -040083 image: {{ deploy_docker_registry }}xosproject/xos-gui:{{ deploy_docker_tag }}
84 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
113 xos_chameleon:
114 image: {{ deploy_docker_registry }}xosproject/chameleon:{{ deploy_docker_tag }}
115 networks:
116{% for network in xos_docker_networks %}
117 - {{ network }}
118{% endfor %}
Matteo Scandolo7023aa22017-05-09 11:34:52 -0700119 command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400120 ports:
121 - "9101:9101"
122 links:
123 - xos_core:xos-core
124 depends_on:
125 - xos_core
126 logging:
127 driver: "json-file"
128 options:
129 max-size: "1000k"
130 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700131 depends_on:
132 - registrator
133 environment:
134 SERVICE_9101_NAME: "xos-rest"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400135 restart: unless-stopped
136
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700137 gui_extensions_store:
Matteo Scandolo05366452017-05-09 15:09:04 -0700138 image: {{ deploy_docker_registry }}node:7.9.0
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400139 networks:
140{% for network in xos_docker_networks %}
141 - {{ network }}
142{% endfor %}
143 command: /bin/true
144 volumes:
145 - /var/www/dist/extensions
146 logging:
147 driver: "json-file"
148 options:
149 max-size: "1000k"
150 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700151 depends_on:
152 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400153
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700154 xos_ws:
155 image: {{ deploy_docker_registry }}xosproject/xos-ws:{{ deploy_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400156 networks:
157{% for network in xos_docker_networks %}
158 - {{ network }}
159{% endfor %}
160 command: npm start -- --config gateway-config.yml
161 ports:
162 - "3000:3000"
163 links:
164 - xos_ui:xos
165{% if use_redis %}
166 - xos_redis:redis
167{% endif %}
168 depends_on:
169 - xos_ui
170{% if use_redis %}
171 - xos_redis
172{% endif %}
173 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700174 - {{ head_cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400175 logging:
176 driver: "json-file"
177 options:
178 max-size: "1000k"
179 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700180 depends_on:
181 - registrator
182 environment:
183 SERVICE_3000_NAME: "xos-ws"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400184 restart: unless-stopped
185
186 xos_ui:
187 image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }}
188 networks:
189{% for network in xos_docker_networks %}
190 - {{ network }}
191{% endfor %}
192 command: python /opt/xos/manage.py runserver 0.0.0.0:9000 --insecure --makemigrations
193 ports:
194 - "9000:9000"
195 links:
196 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700197 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400198{% if use_redis %}
199 - xos_redis:redis
200{% endif %}
201 depends_on:
202 - xos_db
203{% if use_redis %}
204 - xos_redis
205{% endif %}
206 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700207 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
208 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
209 - {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
210 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400211 logging:
212 driver: "json-file"
213 options:
214 max-size: "1000k"
215 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700216 depends_on:
217 - registrator
218 environment:
219 SERVICE_9000_NAME: "xos-ui-deprecated"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400220 restart: unless-stopped
221
222 xos_core:
223 image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }}
224 networks:
225{% for network in xos_docker_networks %}
226 - {{ network }}
227{% endfor %}
228 command: bash -c "cd coreapi; bash ./start_coreapi.sh"
229 ports:
230 - "50051:50051"
231 - "50055:50055"
232 links:
233 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700234 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400235{% if use_redis %}
236 - xos_redis:redis
237{% endif %}
238 depends_on:
239 - xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700240 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400241{% if use_redis %}
242 - xos_redis
243{% endif %}
244 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700245 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
246 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
247 - {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
248 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400249 - /var/run/docker.sock:/var/run/docker.sock
250 logging:
251 driver: "json-file"
252 options:
253 max-size: "1000k"
254 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700255 environment:
256 SERVICE_50051_NAME: "xos-grpc-secure"
257 SERVICE_50055_NAME: "xos-grpc-insecure"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400258 restart: unless-stopped
259
260{% for ext in enabled_gui_extensions %}
261 gui-extension-{{ ext.name }}:
262 image: {{ deploy_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ deploy_docker_tag }}
263 networks:
264{% for network in xos_docker_networks %}
265 - {{ network }}
266{% endfor %}
267 command: npm run build
268 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700269 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400270 logging:
271 driver: "json-file"
272 options:
273 max-size: "1000k"
274 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700275 depends_on:
276 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400277{% endfor %}
278
279{% if not frontend_only %}
280{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700281{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400282 {{ svc.name }}-synchronizer:
283 image: {{ deploy_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ deploy_docker_tag }}
284 networks:
285{% for network in xos_docker_networks %}
286 - {{ network }}
287{% endfor %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400288 depends_on:
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700289 - registrator
290{% if use_redis %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400291 - xos_redis
292{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700293 links:
294 - consul:consul
295{% if use_redis %}
296 - xos_redis:redis
297{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400298 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700299 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
300 - /opt/credentials:/opt/xos/services/{{ svc.name }}/credentials:ro
301 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400302{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700303 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400304{% endif %}
305{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700306 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400307{% endif %}
308 logging:
309 driver: "json-file"
310 options:
311 max-size: "1000k"
312 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700313 environment:
314 SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400315 restart: unless-stopped
316
317{% endif %}
318{% endfor %}
319{% endif %}