blob: b64e837b7f432385e15b6352672e3e959edb13ff [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_common_config:/opt/xos/xos_configuration/xos_common_config:ro
208 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
209 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
210 - {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
211 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400212 logging:
213 driver: "json-file"
214 options:
215 max-size: "1000k"
216 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700217 depends_on:
218 - registrator
219 environment:
220 SERVICE_9000_NAME: "xos-ui-deprecated"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400221 restart: unless-stopped
222
223 xos_core:
224 image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }}
225 networks:
226{% for network in xos_docker_networks %}
227 - {{ network }}
228{% endfor %}
229 command: bash -c "cd coreapi; bash ./start_coreapi.sh"
230 ports:
231 - "50051:50051"
232 - "50055:50055"
233 links:
234 - xos_db:xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700235 - consul:consul
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400236{% if use_redis %}
237 - xos_redis:redis
238{% endif %}
239 depends_on:
240 - xos_db
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700241 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400242{% if use_redis %}
243 - xos_redis
244{% endif %}
245 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700246 - {{ head_cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
247 - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
248 - {{ head_cord_profile_dir }}:/opt/cord_profile:ro
249 - {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
250 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400251 - /var/run/docker.sock:/var/run/docker.sock
252 logging:
253 driver: "json-file"
254 options:
255 max-size: "1000k"
256 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700257 environment:
258 SERVICE_50051_NAME: "xos-grpc-secure"
259 SERVICE_50055_NAME: "xos-grpc-insecure"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400260 restart: unless-stopped
261
262{% for ext in enabled_gui_extensions %}
263 gui-extension-{{ ext.name }}:
264 image: {{ deploy_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ deploy_docker_tag }}
265 networks:
266{% for network in xos_docker_networks %}
267 - {{ network }}
268{% endfor %}
269 command: npm run build
270 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700271 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400272 logging:
273 driver: "json-file"
274 options:
275 max-size: "1000k"
276 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700277 depends_on:
278 - registrator
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400279{% endfor %}
280
281{% if not frontend_only %}
282{% for svc in xos_services %}
Zack Williamsc989f262017-05-11 13:02:59 -0700283{% if svc.synchronizer is not defined or svc.synchronizer %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400284 {{ svc.name }}-synchronizer:
285 image: {{ deploy_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ deploy_docker_tag }}
286 networks:
287{% for network in xos_docker_networks %}
288 - {{ network }}
289{% endfor %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400290 depends_on:
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700291 - registrator
292{% if use_redis %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400293 - xos_redis
294{% endif %}
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700295 links:
296 - consul:consul
297{% if use_redis %}
298 - xos_redis:redis
299{% endif %}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400300 volumes:
Zack Williamsc989f262017-05-11 13:02:59 -0700301 - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
302 - /opt/credentials:/opt/xos/services/{{ svc.name }}/credentials:ro
303 - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400304{% if svc.keypair is defined %}
Zack Williamsc989f262017-05-11 13:02:59 -0700305 - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400306{% endif %}
307{% if svc.name == "openstack" %}
Zack Williamsc989f262017-05-11 13:02:59 -0700308 - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400309{% endif %}
310 logging:
311 driver: "json-file"
312 options:
313 max-size: "1000k"
314 max-file: "5"
Matteo Scandolo893b3d52017-05-18 16:59:53 -0700315 environment:
316 SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400317 restart: unless-stopped
318
319{% endif %}
320{% endfor %}
321{% endif %}