Zack Williams | a39dba0 | 2018-04-02 13:36:56 -0700 | [diff] [blame] | 1 | --- |
Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 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 | |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 18 | version: '2' |
| 19 | |
| 20 | # XOS docker compose |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 21 | # generated by cord-profile/templates/docker-compose.yml.j2 |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 22 | |
| 23 | networks: |
| 24 | {% for network in xos_docker_networks %} |
| 25 | {{ network }}: |
| 26 | external: true |
| 27 | {% endfor %} |
| 28 | |
| 29 | services: |
Varun Belur | 8676453 | 2017-09-08 18:39:58 -0600 | [diff] [blame] | 30 | {% if use_elasticstack %} |
| 31 | elk: |
| 32 | image: {{ pull_docker_registry }}sebp/elk:{{ pull_docker_tag }} |
| 33 | ports: |
| 34 | - "5601:5601" |
| 35 | - "9200:9200" |
| 36 | networks: |
| 37 | {% for network in xos_docker_networks %} |
| 38 | - {{ network }} |
Zack Williams | a39dba0 | 2018-04-02 13:36:56 -0700 | [diff] [blame] | 39 | {% endfor %} |
Varun Belur | 8676453 | 2017-09-08 18:39:58 -0600 | [diff] [blame] | 40 | {% endif %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 41 | xos_db: |
Zack Williams | a39dba0 | 2018-04-02 13:36:56 -0700 | [diff] [blame] | 42 | image: {{ pull_docker_registry }}postgres:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 43 | networks: |
| 44 | {% for network in xos_docker_networks %} |
| 45 | - {{ network }} |
| 46 | {% endfor %} |
Zack Williams | a39dba0 | 2018-04-02 13:36:56 -0700 | [diff] [blame] | 47 | environment: |
| 48 | - POSTGRES_DB={{ xos_db_name }} |
| 49 | - POSTGRES_USER={{ xos_db_username }} |
| 50 | - POSTGRES_PASSWORD={{ xos_db_password }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 51 | expose: |
| 52 | - "5432" |
| 53 | restart: unless-stopped |
| 54 | |
| 55 | {% if use_redis %} |
| 56 | xos_redis: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 57 | image: {{ pull_docker_registry }}redis:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 58 | networks: |
| 59 | {% for network in xos_docker_networks %} |
| 60 | - {{ network }} |
| 61 | {% endfor %} |
| 62 | logging: |
| 63 | driver: "json-file" |
| 64 | options: |
| 65 | max-size: "1000k" |
| 66 | max-file: "5" |
| 67 | restart: unless-stopped |
| 68 | {% endif %} |
| 69 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 70 | xos_gui: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 71 | image: {{ pull_docker_registry }}xosproject/xos-gui:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 72 | networks: |
| 73 | {% for network in xos_docker_networks %} |
| 74 | - {{ network }} |
| 75 | {% endfor %} |
| 76 | ports: |
| 77 | - "4000:4000" |
| 78 | links: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 79 | - xos_ws:xos-ws |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 80 | - xos_chameleon:xos-chameleon |
| 81 | depends_on: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 82 | - xos_ws |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 83 | - xos_chameleon |
| 84 | volumes: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 85 | - {{ head_cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js |
| 86 | - {{ 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] | 87 | volumes_from: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 88 | - gui_extensions_store |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 89 | logging: |
| 90 | driver: "json-file" |
| 91 | options: |
| 92 | max-size: "1000k" |
| 93 | max-file: "5" |
| 94 | restart: unless-stopped |
| 95 | |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 96 | xos_tosca: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 97 | image: {{ pull_docker_registry }}xosproject/xos-tosca:{{ pull_docker_tag }} |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 98 | networks: |
| 99 | {% for network in xos_docker_networks %} |
| 100 | - {{ network }} |
| 101 | {% endfor %} |
| 102 | ports: |
| 103 | - "9102:9102" |
| 104 | links: |
| 105 | - xos_core:xos-core |
| 106 | volumes: |
| 107 | - {{ 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] | 108 | - {{ 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] | 109 | depends_on: |
| 110 | - xos_core |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 111 | logging: |
| 112 | driver: "json-file" |
| 113 | options: |
| 114 | max-size: "1000k" |
| 115 | max-file: "5" |
Matteo Scandolo | c4f2c5f | 2017-07-12 16:25:08 -0700 | [diff] [blame] | 116 | restart: unless-stopped |
| 117 | |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 118 | xos_chameleon: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 119 | image: {{ pull_docker_registry }}xosproject/chameleon:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 120 | networks: |
| 121 | {% for network in xos_docker_networks %} |
| 122 | - {{ network }} |
| 123 | {% endfor %} |
Scott Baker | 02a529f | 2018-02-20 15:12:11 -0800 | [diff] [blame] | 124 | command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs -r |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 125 | ports: |
| 126 | - "9101:9101" |
| 127 | links: |
| 128 | - xos_core:xos-core |
| 129 | depends_on: |
| 130 | - xos_core |
| 131 | logging: |
| 132 | driver: "json-file" |
| 133 | options: |
| 134 | max-size: "1000k" |
| 135 | max-file: "5" |
| 136 | restart: unless-stopped |
| 137 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 138 | gui_extensions_store: |
Andy Bavier | d2cab42 | 2017-07-24 16:38:24 -0700 | [diff] [blame] | 139 | image: {{ pull_docker_registry }}node:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 140 | networks: |
| 141 | {% for network in xos_docker_networks %} |
| 142 | - {{ network }} |
| 143 | {% endfor %} |
| 144 | command: /bin/true |
| 145 | volumes: |
| 146 | - /var/www/dist/extensions |
| 147 | logging: |
| 148 | driver: "json-file" |
| 149 | options: |
| 150 | max-size: "1000k" |
| 151 | max-file: "5" |
| 152 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 153 | xos_ws: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 154 | image: {{ pull_docker_registry }}xosproject/xos-ws:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 155 | networks: |
| 156 | {% for network in xos_docker_networks %} |
| 157 | - {{ network }} |
| 158 | {% endfor %} |
| 159 | command: npm start -- --config gateway-config.yml |
| 160 | ports: |
| 161 | - "3000:3000" |
| 162 | links: |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 163 | {% if use_redis %} |
| 164 | - xos_redis:redis |
| 165 | {% endif %} |
| 166 | depends_on: |
Matteo Scandolo | dd5fc6a | 2018-01-19 16:41:52 -0800 | [diff] [blame] | 167 | - xos_core |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 168 | {% if use_redis %} |
| 169 | - xos_redis |
| 170 | {% endif %} |
| 171 | volumes: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 172 | - {{ 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] | 173 | logging: |
| 174 | driver: "json-file" |
| 175 | options: |
| 176 | max-size: "1000k" |
| 177 | max-file: "5" |
| 178 | restart: unless-stopped |
| 179 | |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 180 | xos_core: |
Scott Baker | e8fcb1c | 2018-03-29 15:31:03 -0700 | [diff] [blame] | 181 | image: {{ pull_docker_registry }}xosproject/xos-core:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 182 | networks: |
| 183 | {% for network in xos_docker_networks %} |
| 184 | - {{ network }} |
| 185 | {% endfor %} |
Sapan Bhatia | 17b48f9 | 2018-01-03 12:42:50 -0500 | [diff] [blame] | 186 | command: bash -c "service filebeat start; cd coreapi; bash ./start_coreapi.sh" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 187 | ports: |
| 188 | - "50051:50051" |
| 189 | - "50055:50055" |
| 190 | links: |
Gopinath Taget | 4c13da6 | 2018-01-19 16:13:19 -0800 | [diff] [blame] | 191 | - xos_db:xos-db |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 192 | {% if use_redis %} |
| 193 | - xos_redis:redis |
| 194 | {% endif %} |
| 195 | depends_on: |
| 196 | - xos_db |
| 197 | {% if use_redis %} |
| 198 | - xos_redis |
| 199 | {% endif %} |
| 200 | volumes: |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 201 | - {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro |
Scott Baker | d69223c | 2018-02-27 11:31:26 -0800 | [diff] [blame] | 202 | - {{ head_cord_profile_dir }}/core_api_cert.pem:/opt/cord_profile/core_api_cert.pem:ro |
| 203 | - {{ head_cord_profile_dir }}/core_api_key.pem:/opt/cord_profile/core_api_key.pem:ro |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 204 | - {{ 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] | 205 | - {{ 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] | 206 | logging: |
| 207 | driver: "json-file" |
| 208 | options: |
| 209 | max-size: "1000k" |
| 210 | max-file: "5" |
| 211 | restart: unless-stopped |
| 212 | |
| 213 | {% for ext in enabled_gui_extensions %} |
| 214 | gui-extension-{{ ext.name }}: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 215 | image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 216 | networks: |
| 217 | {% for network in xos_docker_networks %} |
| 218 | - {{ network }} |
| 219 | {% endfor %} |
Matteo Scandolo | 31634f2 | 2017-11-16 10:30:11 -0800 | [diff] [blame] | 220 | 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] | 221 | volumes_from: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 222 | - gui_extensions_store |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 223 | logging: |
| 224 | driver: "json-file" |
| 225 | options: |
| 226 | max-size: "1000k" |
| 227 | max-file: "5" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 228 | {% endfor %} |
| 229 | |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 230 | {% for svc in xos_services %} |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 231 | {% if svc.synchronizer is not defined or svc.synchronizer %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 232 | {{ svc.name }}-synchronizer: |
Andy Bavier | 75e1712 | 2017-07-26 09:07:19 -0700 | [diff] [blame] | 233 | image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 234 | networks: |
| 235 | {% for network in xos_docker_networks %} |
| 236 | - {{ network }} |
| 237 | {% endfor %} |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 238 | {% if use_redis %} |
Matteo Scandolo | 705f7e9 | 2018-02-09 16:27:29 -0800 | [diff] [blame] | 239 | depends_on: |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 240 | - xos_redis |
| 241 | {% endif %} |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 242 | links: |
Matteo Scandolo | df7a6a7 | 2018-01-11 16:09:38 -0800 | [diff] [blame] | 243 | - xos_core:xos-core |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 244 | {% if use_redis %} |
| 245 | - xos_redis:redis |
| 246 | {% endif %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 247 | volumes: |
Zack Williams | 9cea13e | 2017-07-25 16:32:59 -0700 | [diff] [blame] | 248 | - {{ 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] | 249 | - {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro |
Zack Williams | 7928696 | 2017-07-10 12:24:37 -0700 | [diff] [blame] | 250 | - {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 251 | - {{ 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] | 252 | {% if svc.keypair is defined %} |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 253 | - {{ 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] | 254 | {% endif %} |
| 255 | {% if svc.name == "openstack" %} |
Zack Williams | c989f26 | 2017-05-11 13:02:59 -0700 | [diff] [blame] | 256 | - {{ head_cord_profile_dir }}/images:/opt/xos/images:ro |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 257 | {% endif %} |
| 258 | logging: |
| 259 | driver: "json-file" |
| 260 | options: |
| 261 | max-size: "1000k" |
| 262 | max-file: "5" |
Scott Baker | 719d745 | 2018-01-23 15:55:32 -0800 | [diff] [blame] | 263 | restart: on-failure |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 264 | |
| 265 | {% endif %} |
| 266 | {% endfor %} |