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 |
| 208 | - {{ cord_profile_dir }}:/opt/cord_profile:ro |
| 209 | - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro |
| 210 | - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
| 211 | logging: |
| 212 | driver: "json-file" |
| 213 | options: |
| 214 | max-size: "1000k" |
| 215 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 216 | depends_on: |
| 217 | - registrator |
| 218 | environment: |
| 219 | SERVICE_9000_NAME: "xos-ui-deprecated" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 220 | restart: unless-stopped |
| 221 | |
| 222 | xos_core: |
| 223 | image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }} |
| 224 | networks: |
| 225 | {% for network in xos_docker_networks %} |
| 226 | - {{ network }} |
| 227 | {% endfor %} |
| 228 | command: bash -c "cd coreapi; bash ./start_coreapi.sh" |
| 229 | ports: |
| 230 | - "50051:50051" |
| 231 | - "50055:50055" |
| 232 | links: |
| 233 | - xos_db:xos_db |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 234 | - consul:consul |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 235 | {% if use_redis %} |
| 236 | - xos_redis:redis |
| 237 | {% endif %} |
| 238 | depends_on: |
| 239 | - xos_db |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 240 | - registrator |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 241 | {% if use_redis %} |
| 242 | - xos_redis |
| 243 | {% endif %} |
| 244 | volumes: |
| 245 | - {{ cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro |
| 246 | - {{ cord_profile_dir }}:/opt/cord_profile:ro |
| 247 | - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro |
| 248 | - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
| 249 | - /var/run/docker.sock:/var/run/docker.sock |
| 250 | logging: |
| 251 | driver: "json-file" |
| 252 | options: |
| 253 | max-size: "1000k" |
| 254 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 255 | environment: |
| 256 | SERVICE_50051_NAME: "xos-grpc-secure" |
| 257 | SERVICE_50055_NAME: "xos-grpc-insecure" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 258 | restart: unless-stopped |
| 259 | |
| 260 | {% for ext in enabled_gui_extensions %} |
| 261 | gui-extension-{{ ext.name }}: |
| 262 | image: {{ deploy_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ deploy_docker_tag }} |
| 263 | networks: |
| 264 | {% for network in xos_docker_networks %} |
| 265 | - {{ network }} |
| 266 | {% endfor %} |
| 267 | command: npm run build |
| 268 | volumes_from: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 269 | - gui_extensions_store |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 270 | logging: |
| 271 | driver: "json-file" |
| 272 | options: |
| 273 | max-size: "1000k" |
| 274 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 275 | depends_on: |
| 276 | - registrator |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 277 | {% endfor %} |
| 278 | |
| 279 | {% if not frontend_only %} |
| 280 | {% for svc in xos_services %} |
| 281 | {% if svc.synchronizer is defined and svc.synchronizer %} |
| 282 | {{ svc.name }}-synchronizer: |
| 283 | image: {{ deploy_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ deploy_docker_tag }} |
| 284 | networks: |
| 285 | {% for network in xos_docker_networks %} |
| 286 | - {{ network }} |
| 287 | {% endfor %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 288 | depends_on: |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 289 | - registrator |
| 290 | {% if use_redis %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 291 | - xos_redis |
| 292 | {% endif %} |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 293 | links: |
| 294 | - consul:consul |
| 295 | {% if use_redis %} |
| 296 | - xos_redis:redis |
| 297 | {% endif %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 298 | volumes: |
| 299 | - {{ cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro |
| 300 | - {{ cord_dir }}/build/platform-install/credentials/xosadmin@opencord.org:/opt/xos/services/{{ svc.name }}/credentials/xosadmin@opencord.org:ro |
| 301 | - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
| 302 | {% if svc.keypair is defined %} |
| 303 | - {{ cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro |
| 304 | {% endif %} |
| 305 | {% if svc.name == "openstack" %} |
| 306 | - {{ cord_profile_dir }}/images:/opt/xos/images:ro |
| 307 | {% endif %} |
| 308 | logging: |
| 309 | driver: "json-file" |
| 310 | options: |
| 311 | max-size: "1000k" |
| 312 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame] | 313 | environment: |
| 314 | SERVICE_NAME: "xos-{{ svc.name }}-synchronizer" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 315 | restart: unless-stopped |
| 316 | |
| 317 | {% endif %} |
| 318 | {% endfor %} |
| 319 | {% endif %} |