Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 1 | version: '2' |
| 2 | |
| 3 | # XOS docker compose |
| 4 | # generated by platform-install/roles/cord-profile |
| 5 | |
| 6 | networks: |
| 7 | {% for network in xos_docker_networks %} |
| 8 | {{ network }}: |
| 9 | external: true |
| 10 | {% endfor %} |
| 11 | |
| 12 | services: |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 13 | 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 Scandolo | 602dd3e | 2017-05-25 22:36:15 -0700 | [diff] [blame] | 23 | SERVICE_8300_IGNORE: "yes" |
| 24 | SERVICE_8301_IGNORE: "yes" |
| 25 | SERVICE_8302_IGNORE: "yes" |
| 26 | SERVICE_8400_IGNORE: "yes" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 27 | SERVICE_8500_NAME: "consul-rest" |
Matteo Scandolo | 602dd3e | 2017-05-25 22:36:15 -0700 | [diff] [blame] | 28 | SERVICE_8600_IGNORE: "yes" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 29 | restart: unless-stopped |
| 30 | registrator: |
| 31 | image: {{ deploy_docker_registry }}gliderlabs/registrator:{{ deploy_docker_tag }} |
| 32 | command: [ |
| 33 | "-ip=${DOCKER_HOST_IP}", |
Matteo Scandolo | 602dd3e | 2017-05-25 22:36:15 -0700 | [diff] [blame] | 34 | "-internal", |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 35 | "-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 Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 49 | 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 Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 57 | depends_on: |
| 58 | - registrator |
| 59 | environment: |
| 60 | SERVICE_5432_NAME: "xos-db" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 61 | 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 Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 75 | depends_on: |
| 76 | - registrator |
| 77 | environment: |
| 78 | SERVICE_NAME: "redis" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 79 | restart: unless-stopped |
| 80 | {% endif %} |
| 81 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 82 | xos_gui: |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 83 | 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 Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 91 | - xos_ws:xos-ws |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 92 | - xos_chameleon:xos-chameleon |
| 93 | depends_on: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 94 | - xos_ws |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 95 | - xos_chameleon |
| 96 | volumes: |
| 97 | - {{ cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js |
| 98 | - {{ cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js |
| 99 | volumes_from: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 100 | - gui_extensions_store |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 101 | logging: |
| 102 | driver: "json-file" |
| 103 | options: |
| 104 | max-size: "1000k" |
| 105 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 106 | depends_on: |
| 107 | - registrator |
| 108 | environment: |
| 109 | SERVICE_4000_NAME: "xos-gui" |
Matteo Scandolo | 602dd3e | 2017-05-25 22:36:15 -0700 | [diff] [blame] | 110 | SERVICE_80_IGNORE: "yes" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 111 | 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 Scandolo | 7023aa2 | 2017-05-09 11:34:52 -0700 | [diff] [blame] | 119 | 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] | 120 | 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 Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 131 | depends_on: |
| 132 | - registrator |
| 133 | environment: |
| 134 | SERVICE_9101_NAME: "xos-rest" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 135 | restart: unless-stopped |
| 136 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 137 | gui_extensions_store: |
Matteo Scandolo | 0536645 | 2017-05-09 15:09:04 -0700 | [diff] [blame] | 138 | image: {{ deploy_docker_registry }}node:7.9.0 |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 139 | 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 Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 151 | depends_on: |
| 152 | - registrator |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 153 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 154 | xos_ws: |
| 155 | image: {{ deploy_docker_registry }}xosproject/xos-ws:{{ deploy_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 156 | 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: |
| 174 | - {{ cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml |
| 175 | logging: |
| 176 | driver: "json-file" |
| 177 | options: |
| 178 | max-size: "1000k" |
| 179 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 180 | depends_on: |
| 181 | - registrator |
| 182 | environment: |
| 183 | SERVICE_3000_NAME: "xos-ws" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 184 | 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 Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 197 | - consul:consul |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 198 | {% 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: |
| 207 | - {{ cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro |
Matteo Scandolo | d222134 | 2017-05-25 18:16:57 -0700 | [diff] [blame] | 208 | - {{ cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 209 | - {{ cord_profile_dir }}:/opt/cord_profile:ro |
| 210 | - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro |
| 211 | - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
| 212 | logging: |
| 213 | driver: "json-file" |
| 214 | options: |
| 215 | max-size: "1000k" |
| 216 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 217 | depends_on: |
| 218 | - registrator |
| 219 | environment: |
| 220 | SERVICE_9000_NAME: "xos-ui-deprecated" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 221 | 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 Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 235 | - consul:consul |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 236 | {% if use_redis %} |
| 237 | - xos_redis:redis |
| 238 | {% endif %} |
| 239 | depends_on: |
| 240 | - xos_db |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 241 | - registrator |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 242 | {% if use_redis %} |
| 243 | - xos_redis |
| 244 | {% endif %} |
| 245 | volumes: |
| 246 | - {{ cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro |
Matteo Scandolo | d222134 | 2017-05-25 18:16:57 -0700 | [diff] [blame] | 247 | - {{ cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 248 | - {{ cord_profile_dir }}:/opt/cord_profile:ro |
| 249 | - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro |
| 250 | - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
| 251 | - /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 Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 257 | environment: |
| 258 | SERVICE_50051_NAME: "xos-grpc-secure" |
| 259 | SERVICE_50055_NAME: "xos-grpc-insecure" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 260 | 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 Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 271 | - gui_extensions_store |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 272 | logging: |
| 273 | driver: "json-file" |
| 274 | options: |
| 275 | max-size: "1000k" |
| 276 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 277 | depends_on: |
| 278 | - registrator |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 279 | {% endfor %} |
| 280 | |
| 281 | {% if not frontend_only %} |
| 282 | {% for svc in xos_services %} |
| 283 | {% if svc.synchronizer is defined and svc.synchronizer %} |
| 284 | {{ 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 Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 290 | depends_on: |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 291 | - registrator |
| 292 | {% if use_redis %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 293 | - xos_redis |
| 294 | {% endif %} |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 295 | links: |
| 296 | - consul:consul |
| 297 | {% if use_redis %} |
| 298 | - xos_redis:redis |
| 299 | {% endif %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 300 | volumes: |
| 301 | - {{ cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro |
| 302 | - {{ cord_dir }}/build/platform-install/credentials/xosadmin@opencord.org:/opt/xos/services/{{ svc.name }}/credentials/xosadmin@opencord.org:ro |
| 303 | - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
| 304 | {% if svc.keypair is defined %} |
| 305 | - {{ cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro |
| 306 | {% endif %} |
| 307 | {% if svc.name == "openstack" %} |
| 308 | - {{ cord_profile_dir }}/images:/opt/xos/images:ro |
| 309 | {% endif %} |
| 310 | logging: |
| 311 | driver: "json-file" |
| 312 | options: |
| 313 | max-size: "1000k" |
| 314 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 315 | environment: |
| 316 | SERVICE_NAME: "xos-{{ svc.name }}-synchronizer" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 317 | restart: unless-stopped |
| 318 | |
| 319 | {% endif %} |
| 320 | {% endfor %} |
| 321 | {% endif %} |