blob: 31e6e703be46b6b8fc5e7d8cd38109ddf8a2beb7 [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:
13 xos_db:
14 image: {{ deploy_docker_registry }}xosproject/xos-postgres:{{ deploy_docker_tag }}
15 networks:
16{% for network in xos_docker_networks %}
17 - {{ network }}
18{% endfor %}
19 expose:
20 - "5432"
21 restart: unless-stopped
22
23{% if use_redis %}
24 xos_redis:
25 image: {{ deploy_docker_registry }}redis:{{ deploy_docker_tag }}
26 networks:
27{% for network in xos_docker_networks %}
28 - {{ network }}
29{% endfor %}
30 logging:
31 driver: "json-file"
32 options:
33 max-size: "1000k"
34 max-file: "5"
35 restart: unless-stopped
36{% endif %}
37
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070038 xos_gui:
Andy Bavier9e7d54a2017-04-17 11:37:02 -040039 image: {{ deploy_docker_registry }}xosproject/xos-gui:{{ deploy_docker_tag }}
40 networks:
41{% for network in xos_docker_networks %}
42 - {{ network }}
43{% endfor %}
44 ports:
45 - "4000:4000"
46 links:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070047 - xos_ws:xos-ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040048 - xos_chameleon:xos-chameleon
49 depends_on:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070050 - xos_ws
Andy Bavier9e7d54a2017-04-17 11:37:02 -040051 - xos_chameleon
52 volumes:
53 - {{ cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js
54 - {{ cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js
55 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070056 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -040057 logging:
58 driver: "json-file"
59 options:
60 max-size: "1000k"
61 max-file: "5"
62 restart: unless-stopped
63
64 xos_chameleon:
65 image: {{ deploy_docker_registry }}xosproject/chameleon:{{ deploy_docker_tag }}
66 networks:
67{% for network in xos_docker_networks %}
68 - {{ network }}
69{% endfor %}
70 command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055
71 ports:
72 - "9101:9101"
73 links:
74 - xos_core:xos-core
75 depends_on:
76 - xos_core
77 logging:
78 driver: "json-file"
79 options:
80 max-size: "1000k"
81 max-file: "5"
82 restart: unless-stopped
83
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070084 gui_extensions_store:
Andy Bavier9e7d54a2017-04-17 11:37:02 -040085 image: {{ deploy_docker_registry }}node:argon
86 networks:
87{% for network in xos_docker_networks %}
88 - {{ network }}
89{% endfor %}
90 command: /bin/true
91 volumes:
92 - /var/www/dist/extensions
93 logging:
94 driver: "json-file"
95 options:
96 max-size: "1000k"
97 max-file: "5"
98
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -070099 xos_ws:
100 image: {{ deploy_docker_registry }}xosproject/xos-ws:{{ deploy_docker_tag }}
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400101 networks:
102{% for network in xos_docker_networks %}
103 - {{ network }}
104{% endfor %}
105 command: npm start -- --config gateway-config.yml
106 ports:
107 - "3000:3000"
108 links:
109 - xos_ui:xos
110{% if use_redis %}
111 - xos_redis:redis
112{% endif %}
113 depends_on:
114 - xos_ui
115{% if use_redis %}
116 - xos_redis
117{% endif %}
118 volumes:
119 - {{ cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
120 logging:
121 driver: "json-file"
122 options:
123 max-size: "1000k"
124 max-file: "5"
125 restart: unless-stopped
126
127 xos_ui:
128 image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }}
129 networks:
130{% for network in xos_docker_networks %}
131 - {{ network }}
132{% endfor %}
133 command: python /opt/xos/manage.py runserver 0.0.0.0:9000 --insecure --makemigrations
134 ports:
135 - "9000:9000"
136 links:
137 - xos_db:xos_db
138{% if use_redis %}
139 - xos_redis:redis
140{% endif %}
141 depends_on:
142 - xos_db
143{% if use_redis %}
144 - xos_redis
145{% endif %}
146 volumes:
147 - {{ cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
148 - {{ cord_profile_dir }}:/opt/cord_profile:ro
149 - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
150 - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
151 logging:
152 driver: "json-file"
153 options:
154 max-size: "1000k"
155 max-file: "5"
156 restart: unless-stopped
157
158 xos_core:
159 image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }}
160 networks:
161{% for network in xos_docker_networks %}
162 - {{ network }}
163{% endfor %}
164 command: bash -c "cd coreapi; bash ./start_coreapi.sh"
165 ports:
166 - "50051:50051"
167 - "50055:50055"
168 links:
169 - xos_db:xos_db
170{% if use_redis %}
171 - xos_redis:redis
172{% endif %}
173 depends_on:
174 - xos_db
175{% if use_redis %}
176 - xos_redis
177{% endif %}
178 volumes:
179 - {{ cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro
180 - {{ cord_profile_dir }}:/opt/cord_profile:ro
181 - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
182 - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
183 - /var/run/docker.sock:/var/run/docker.sock
184 logging:
185 driver: "json-file"
186 options:
187 max-size: "1000k"
188 max-file: "5"
189 restart: unless-stopped
190
191{% for ext in enabled_gui_extensions %}
192 gui-extension-{{ ext.name }}:
193 image: {{ deploy_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ deploy_docker_tag }}
194 networks:
195{% for network in xos_docker_networks %}
196 - {{ network }}
197{% endfor %}
198 command: npm run build
199 volumes_from:
Matteo Scandolofb9ac8a2017-04-19 15:51:11 -0700200 - gui_extensions_store
Andy Bavier9e7d54a2017-04-17 11:37:02 -0400201 logging:
202 driver: "json-file"
203 options:
204 max-size: "1000k"
205 max-file: "5"
206
207{% endfor %}
208
209{% if not frontend_only %}
210{% for svc in xos_services %}
211{% if svc.synchronizer is defined and svc.synchronizer %}
212 {{ svc.name }}-synchronizer:
213 image: {{ deploy_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ deploy_docker_tag }}
214 networks:
215{% for network in xos_docker_networks %}
216 - {{ network }}
217{% endfor %}
218{% if use_redis %}
219 links:
220 - xos_redis:redis
221 depends_on:
222 - xos_redis
223{% endif %}
224 volumes:
225 - {{ cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
226 - {{ cord_dir }}/build/platform-install/credentials/xosadmin@opencord.org:/opt/xos/services/{{ svc.name }}/credentials/xosadmin@opencord.org:ro
227 - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
228{% if svc.keypair is defined %}
229 - {{ cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
230{% endif %}
231{% if svc.name == "openstack" %}
232 - {{ cord_profile_dir }}/images:/opt/xos/images:ro
233{% endif %}
234 logging:
235 driver: "json-file"
236 options:
237 max-size: "1000k"
238 max-file: "5"
239 restart: unless-stopped
240
241{% endif %}
242{% endfor %}
243{% endif %}