Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | |
| 2 | {# |
| 3 | Copyright 2017-present Open Networking Foundation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | #} |
| 17 | |
| 18 | |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 19 | version: '2' |
| 20 | |
| 21 | # XOS docker compose |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 22 | # generated by cord-profile/templates/docker-compose.yml.j2 |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 23 | |
| 24 | networks: |
| 25 | {% for network in xos_docker_networks %} |
| 26 | {{ network }}: |
| 27 | external: true |
| 28 | {% endfor %} |
| 29 | |
| 30 | services: |
Varun Belur | 8676453 | 2017-09-08 18:39:58 -0600 | [diff] [blame] | 31 | {% if use_elasticstack %} |
| 32 | elk: |
| 33 | image: {{ pull_docker_registry }}sebp/elk:{{ pull_docker_tag }} |
| 34 | ports: |
| 35 | - "5601:5601" |
| 36 | - "9200:9200" |
| 37 | networks: |
| 38 | {% for network in xos_docker_networks %} |
| 39 | - {{ network }} |
| 40 | {% endfor %} |
| 41 | {% endif %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 42 | xos_db: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 43 | image: {{ pull_docker_registry }}xosproject/xos-postgres:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 44 | networks: |
| 45 | {% for network in xos_docker_networks %} |
| 46 | - {{ network }} |
| 47 | {% endfor %} |
| 48 | expose: |
| 49 | - "5432" |
| 50 | restart: unless-stopped |
| 51 | |
| 52 | {% if use_redis %} |
| 53 | xos_redis: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 54 | image: {{ pull_docker_registry }}redis:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 55 | networks: |
| 56 | {% for network in xos_docker_networks %} |
| 57 | - {{ network }} |
| 58 | {% endfor %} |
| 59 | logging: |
| 60 | driver: "json-file" |
| 61 | options: |
| 62 | max-size: "1000k" |
| 63 | max-file: "5" |
| 64 | restart: unless-stopped |
| 65 | {% endif %} |
| 66 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 67 | xos_gui: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 68 | image: {{ pull_docker_registry }}xosproject/xos-gui:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 69 | networks: |
| 70 | {% for network in xos_docker_networks %} |
| 71 | - {{ network }} |
| 72 | {% endfor %} |
| 73 | ports: |
| 74 | - "4000:4000" |
| 75 | links: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 76 | - xos_ws:xos-ws |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 77 | - xos_chameleon:xos-chameleon |
| 78 | depends_on: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 79 | - xos_ws |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 80 | - xos_chameleon |
| 81 | volumes: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 82 | - {{ head_cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js |
| 83 | - {{ head_cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 84 | volumes_from: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 85 | - gui_extensions_store |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 86 | logging: |
| 87 | driver: "json-file" |
| 88 | options: |
| 89 | max-size: "1000k" |
| 90 | max-file: "5" |
| 91 | restart: unless-stopped |
| 92 | |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 93 | xos_tosca: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 94 | image: {{ pull_docker_registry }}xosproject/xos-tosca:{{ pull_docker_tag }} |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 95 | networks: |
| 96 | {% for network in xos_docker_networks %} |
| 97 | - {{ network }} |
| 98 | {% endfor %} |
| 99 | ports: |
| 100 | - "9102:9102" |
| 101 | links: |
| 102 | - xos_core:xos-core |
| 103 | volumes: |
| 104 | - {{ head_cord_profile_dir }}/xos-tosca.config.yaml:/opt/xos-tosca/src/xos-tosca.config.yaml |
Matteo Scandolo | 9b5e668 | 2017-09-13 08:51:20 -0700 | [diff] [blame] | 105 | - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 106 | depends_on: |
| 107 | - xos_core |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 108 | logging: |
| 109 | driver: "json-file" |
| 110 | options: |
| 111 | max-size: "1000k" |
| 112 | max-file: "5" |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 113 | restart: unless-stopped |
| 114 | |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 115 | xos_chameleon: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 116 | image: {{ pull_docker_registry }}xosproject/chameleon:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 117 | networks: |
| 118 | {% for network in xos_docker_networks %} |
| 119 | - {{ network }} |
| 120 | {% endfor %} |
Matteo Scandolo | 7023aa2 | 2017-05-09 11:34:52 -0700 | [diff] [blame] | 121 | command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 122 | ports: |
| 123 | - "9101:9101" |
| 124 | links: |
| 125 | - xos_core:xos-core |
| 126 | depends_on: |
| 127 | - xos_core |
| 128 | logging: |
| 129 | driver: "json-file" |
| 130 | options: |
| 131 | max-size: "1000k" |
| 132 | max-file: "5" |
| 133 | restart: unless-stopped |
| 134 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 135 | gui_extensions_store: |
Andy Bavier | d2cab42 | 2017-07-24 16:38:24 -0700 | [diff] [blame] | 136 | image: {{ pull_docker_registry }}node:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 137 | networks: |
| 138 | {% for network in xos_docker_networks %} |
| 139 | - {{ network }} |
| 140 | {% endfor %} |
| 141 | command: /bin/true |
| 142 | volumes: |
| 143 | - /var/www/dist/extensions |
| 144 | logging: |
| 145 | driver: "json-file" |
| 146 | options: |
| 147 | max-size: "1000k" |
| 148 | max-file: "5" |
| 149 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 150 | xos_ws: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 151 | image: {{ pull_docker_registry }}xosproject/xos-ws:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 152 | networks: |
| 153 | {% for network in xos_docker_networks %} |
| 154 | - {{ network }} |
| 155 | {% endfor %} |
| 156 | command: npm start -- --config gateway-config.yml |
| 157 | ports: |
| 158 | - "3000:3000" |
| 159 | links: |
Matteo Scandolo | dd5fc6a | 2018-01-19 16:41:52 -0800 | [diff] [blame] | 160 | - xos_core:xos |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 161 | {% if use_redis %} |
| 162 | - xos_redis:redis |
| 163 | {% endif %} |
| 164 | depends_on: |
Matteo Scandolo | dd5fc6a | 2018-01-19 16:41:52 -0800 | [diff] [blame] | 165 | - xos_core |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 166 | {% if use_redis %} |
| 167 | - xos_redis |
| 168 | {% endif %} |
| 169 | volumes: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 170 | - {{ head_cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 171 | logging: |
| 172 | driver: "json-file" |
| 173 | options: |
| 174 | max-size: "1000k" |
| 175 | max-file: "5" |
| 176 | restart: unless-stopped |
| 177 | |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 178 | xos_core: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 179 | image: {{ pull_docker_registry }}xosproject/xos-ui:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 180 | networks: |
| 181 | {% for network in xos_docker_networks %} |
| 182 | - {{ network }} |
| 183 | {% endfor %} |
Sapan Bhatia | 17b48f9 | 2018-01-03 12:42:50 -0500 | [diff] [blame] | 184 | command: bash -c "service filebeat start; cd coreapi; bash ./start_coreapi.sh" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 185 | ports: |
| 186 | - "50051:50051" |
| 187 | - "50055:50055" |
| 188 | links: |
Gopinath Taget | 4c13da6 | 2018-01-19 16:13:19 -0800 | [diff] [blame] | 189 | - xos_db:xos-db |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 190 | {% if use_redis %} |
| 191 | - xos_redis:redis |
| 192 | {% endif %} |
| 193 | depends_on: |
| 194 | - xos_db |
| 195 | {% if use_redis %} |
| 196 | - xos_redis |
| 197 | {% endif %} |
| 198 | volumes: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 199 | - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro |
| 200 | - {{ head_cord_profile_dir }}:/opt/cord_profile:ro |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 201 | - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
Matteo Scandolo | b92469d | 2017-07-28 17:32:00 -0700 | [diff] [blame] | 202 | - {{ head_cord_profile_dir }}/initial_data.yaml:/opt/xos/core/migrations/initial_data.yaml:ro |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 203 | - /var/run/docker.sock:/var/run/docker.sock |
| 204 | logging: |
| 205 | driver: "json-file" |
| 206 | options: |
| 207 | max-size: "1000k" |
| 208 | max-file: "5" |
| 209 | restart: unless-stopped |
| 210 | |
| 211 | {% for ext in enabled_gui_extensions %} |
| 212 | gui-extension-{{ ext.name }}: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 213 | image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 214 | networks: |
| 215 | {% for network in xos_docker_networks %} |
| 216 | - {{ network }} |
| 217 | {% endfor %} |
Matteo Scandolo | 31634f2 | 2017-11-16 10:30:11 -0800 | [diff] [blame] | 218 | command: /bin/sh -c "mkdir -p /var/www/dist/extensions/{{ ext.name }}/ && cp -R /tmp/* /var/www/dist/extensions/{{ ext.name }}/" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 219 | volumes_from: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 220 | - gui_extensions_store |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 221 | logging: |
| 222 | driver: "json-file" |
| 223 | options: |
| 224 | max-size: "1000k" |
| 225 | max-file: "5" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 226 | {% endfor %} |
| 227 | |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 228 | {% for svc in xos_services %} |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 229 | {% if svc.synchronizer is not defined or svc.synchronizer %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 230 | {{ svc.name }}-synchronizer: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 231 | image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 232 | networks: |
| 233 | {% for network in xos_docker_networks %} |
| 234 | - {{ network }} |
| 235 | {% endfor %} |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 236 | {% if use_redis %} |
Matteo Scandolo | 705f7e9 | 2018-02-09 16:27:29 -0800 | [diff] [blame] | 237 | depends_on: |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 238 | - xos_redis |
| 239 | {% endif %} |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 240 | links: |
Matteo Scandolo | df7a6a7 | 2018-01-11 16:09:38 -0800 | [diff] [blame] | 241 | - xos_core:xos-core |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 242 | {% if use_redis %} |
| 243 | - xos_redis:redis |
| 244 | {% endif %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 245 | volumes: |
Zack Williams | 9cea13e | 2017-07-25 16:32:59 -0700 | [diff] [blame] | 246 | - {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 247 | - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 248 | - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 249 | - {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 250 | {% if svc.keypair is defined %} |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 251 | - {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 252 | {% endif %} |
| 253 | {% if svc.name == "openstack" %} |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 254 | - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 255 | {% endif %} |
| 256 | logging: |
| 257 | driver: "json-file" |
| 258 | options: |
| 259 | max-size: "1000k" |
| 260 | max-file: "5" |
Scott Baker | 719d745 | 2018-01-23 15:55:32 -0800 | [diff] [blame] | 261 | restart: on-failure |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 262 | |
| 263 | {% endif %} |
| 264 | {% endfor %} |