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: |
| 23 | SERVICE_8500_NAME: "consul-rest" |
| 24 | restart: unless-stopped |
| 25 | registrator: |
| 26 | image: {{ deploy_docker_registry }}gliderlabs/registrator:{{ deploy_docker_tag }} |
| 27 | command: [ |
| 28 | "-ip=${DOCKER_HOST_IP}", |
| 29 | "-retry-attempts", "100", |
| 30 | "consul://consul:8500" |
| 31 | ] |
| 32 | networks: |
| 33 | {% for network in xos_docker_networks %} |
| 34 | - {{ network }} |
| 35 | {% endfor %} |
| 36 | links: |
| 37 | - consul |
| 38 | volumes: |
| 39 | - /var/run/docker.sock:/tmp/docker.sock |
| 40 | depends_on: |
| 41 | - consul |
| 42 | restart: unless-stopped |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 43 | xos_db: |
| 44 | image: {{ deploy_docker_registry }}xosproject/xos-postgres:{{ deploy_docker_tag }} |
| 45 | networks: |
| 46 | {% for network in xos_docker_networks %} |
| 47 | - {{ network }} |
| 48 | {% endfor %} |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 49 | ports: |
| 50 | - "5432:5432" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 51 | expose: |
| 52 | - "5432" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 53 | depends_on: |
| 54 | - registrator |
| 55 | environment: |
| 56 | SERVICE_5432_NAME: "xos-db" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 57 | restart: unless-stopped |
| 58 | |
| 59 | {% if use_redis %} |
| 60 | xos_redis: |
| 61 | image: {{ deploy_docker_registry }}redis:{{ deploy_docker_tag }} |
| 62 | networks: |
| 63 | {% for network in xos_docker_networks %} |
| 64 | - {{ network }} |
| 65 | {% endfor %} |
| 66 | logging: |
| 67 | driver: "json-file" |
| 68 | options: |
| 69 | max-size: "1000k" |
| 70 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 71 | depends_on: |
| 72 | - registrator |
| 73 | environment: |
| 74 | SERVICE_NAME: "redis" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 75 | restart: unless-stopped |
| 76 | {% endif %} |
| 77 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 78 | xos_gui: |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 79 | image: {{ deploy_docker_registry }}xosproject/xos-gui:{{ deploy_docker_tag }} |
| 80 | networks: |
| 81 | {% for network in xos_docker_networks %} |
| 82 | - {{ network }} |
| 83 | {% endfor %} |
| 84 | ports: |
| 85 | - "4000:4000" |
| 86 | links: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 87 | - xos_ws:xos-ws |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 88 | - xos_chameleon:xos-chameleon |
| 89 | depends_on: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 90 | - xos_ws |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 91 | - xos_chameleon |
| 92 | volumes: |
| 93 | - {{ cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js |
| 94 | - {{ cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js |
| 95 | volumes_from: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 96 | - gui_extensions_store |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 97 | logging: |
| 98 | driver: "json-file" |
| 99 | options: |
| 100 | max-size: "1000k" |
| 101 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 102 | depends_on: |
| 103 | - registrator |
| 104 | environment: |
| 105 | SERVICE_4000_NAME: "xos-gui" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 106 | restart: unless-stopped |
| 107 | |
| 108 | xos_chameleon: |
| 109 | image: {{ deploy_docker_registry }}xosproject/chameleon:{{ deploy_docker_tag }} |
| 110 | networks: |
| 111 | {% for network in xos_docker_networks %} |
| 112 | - {{ network }} |
| 113 | {% endfor %} |
Matteo Scandolo | 7023aa2 | 2017-05-09 11:34:52 -0700 | [diff] [blame] | 114 | 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] | 115 | ports: |
| 116 | - "9101:9101" |
| 117 | links: |
| 118 | - xos_core:xos-core |
| 119 | depends_on: |
| 120 | - xos_core |
| 121 | logging: |
| 122 | driver: "json-file" |
| 123 | options: |
| 124 | max-size: "1000k" |
| 125 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 126 | depends_on: |
| 127 | - registrator |
| 128 | environment: |
| 129 | SERVICE_9101_NAME: "xos-rest" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 130 | restart: unless-stopped |
| 131 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 132 | gui_extensions_store: |
Matteo Scandolo | 0536645 | 2017-05-09 15:09:04 -0700 | [diff] [blame] | 133 | image: {{ deploy_docker_registry }}node:7.9.0 |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 134 | networks: |
| 135 | {% for network in xos_docker_networks %} |
| 136 | - {{ network }} |
| 137 | {% endfor %} |
| 138 | command: /bin/true |
| 139 | volumes: |
| 140 | - /var/www/dist/extensions |
| 141 | logging: |
| 142 | driver: "json-file" |
| 143 | options: |
| 144 | max-size: "1000k" |
| 145 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 146 | depends_on: |
| 147 | - registrator |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 148 | |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 149 | xos_ws: |
| 150 | image: {{ deploy_docker_registry }}xosproject/xos-ws:{{ deploy_docker_tag }} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 151 | networks: |
| 152 | {% for network in xos_docker_networks %} |
| 153 | - {{ network }} |
| 154 | {% endfor %} |
| 155 | command: npm start -- --config gateway-config.yml |
| 156 | ports: |
| 157 | - "3000:3000" |
| 158 | links: |
| 159 | - xos_ui:xos |
| 160 | {% if use_redis %} |
| 161 | - xos_redis:redis |
| 162 | {% endif %} |
| 163 | depends_on: |
| 164 | - xos_ui |
| 165 | {% if use_redis %} |
| 166 | - xos_redis |
| 167 | {% endif %} |
| 168 | volumes: |
| 169 | - {{ cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml |
| 170 | logging: |
| 171 | driver: "json-file" |
| 172 | options: |
| 173 | max-size: "1000k" |
| 174 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 175 | depends_on: |
| 176 | - registrator |
| 177 | environment: |
| 178 | SERVICE_3000_NAME: "xos-ws" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 179 | restart: unless-stopped |
| 180 | |
| 181 | xos_ui: |
| 182 | image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }} |
| 183 | networks: |
| 184 | {% for network in xos_docker_networks %} |
| 185 | - {{ network }} |
| 186 | {% endfor %} |
| 187 | command: python /opt/xos/manage.py runserver 0.0.0.0:9000 --insecure --makemigrations |
| 188 | ports: |
| 189 | - "9000:9000" |
| 190 | links: |
| 191 | - xos_db:xos_db |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 192 | - consul:consul |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 193 | {% if use_redis %} |
| 194 | - xos_redis:redis |
| 195 | {% endif %} |
| 196 | depends_on: |
| 197 | - xos_db |
| 198 | {% if use_redis %} |
| 199 | - xos_redis |
| 200 | {% endif %} |
| 201 | volumes: |
| 202 | - {{ cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro |
| 203 | - {{ cord_profile_dir }}:/opt/cord_profile:ro |
| 204 | - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro |
| 205 | - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
| 206 | logging: |
| 207 | driver: "json-file" |
| 208 | options: |
| 209 | max-size: "1000k" |
| 210 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 211 | depends_on: |
| 212 | - registrator |
| 213 | environment: |
| 214 | SERVICE_9000_NAME: "xos-ui-deprecated" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 215 | restart: unless-stopped |
| 216 | |
| 217 | xos_core: |
| 218 | image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }} |
| 219 | networks: |
| 220 | {% for network in xos_docker_networks %} |
| 221 | - {{ network }} |
| 222 | {% endfor %} |
| 223 | command: bash -c "cd coreapi; bash ./start_coreapi.sh" |
| 224 | ports: |
| 225 | - "50051:50051" |
| 226 | - "50055:50055" |
| 227 | links: |
| 228 | - xos_db:xos_db |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 229 | - consul:consul |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 230 | {% if use_redis %} |
| 231 | - xos_redis:redis |
| 232 | {% endif %} |
| 233 | depends_on: |
| 234 | - xos_db |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 235 | - registrator |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 236 | {% if use_redis %} |
| 237 | - xos_redis |
| 238 | {% endif %} |
| 239 | volumes: |
| 240 | - {{ cord_profile_dir }}/xos_common_config:/opt/xos/xos_configuration/xos_common_config:ro |
| 241 | - {{ cord_profile_dir }}:/opt/cord_profile:ro |
| 242 | - {{ cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro |
| 243 | - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
| 244 | - /var/run/docker.sock:/var/run/docker.sock |
| 245 | logging: |
| 246 | driver: "json-file" |
| 247 | options: |
| 248 | max-size: "1000k" |
| 249 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 250 | environment: |
| 251 | SERVICE_50051_NAME: "xos-grpc-secure" |
| 252 | SERVICE_50055_NAME: "xos-grpc-insecure" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 253 | restart: unless-stopped |
| 254 | |
| 255 | {% for ext in enabled_gui_extensions %} |
| 256 | gui-extension-{{ ext.name }}: |
| 257 | image: {{ deploy_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ deploy_docker_tag }} |
| 258 | networks: |
| 259 | {% for network in xos_docker_networks %} |
| 260 | - {{ network }} |
| 261 | {% endfor %} |
| 262 | command: npm run build |
| 263 | volumes_from: |
Matteo Scandolo | fb9ac8a | 2017-04-19 15:51:11 -0700 | [diff] [blame] | 264 | - gui_extensions_store |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 265 | logging: |
| 266 | driver: "json-file" |
| 267 | options: |
| 268 | max-size: "1000k" |
| 269 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 270 | depends_on: |
| 271 | - registrator |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 272 | {% endfor %} |
| 273 | |
| 274 | {% if not frontend_only %} |
| 275 | {% for svc in xos_services %} |
| 276 | {% if svc.synchronizer is defined and svc.synchronizer %} |
| 277 | {{ svc.name }}-synchronizer: |
| 278 | image: {{ deploy_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ deploy_docker_tag }} |
| 279 | networks: |
| 280 | {% for network in xos_docker_networks %} |
| 281 | - {{ network }} |
| 282 | {% endfor %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 283 | depends_on: |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 284 | - registrator |
| 285 | {% if use_redis %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 286 | - xos_redis |
| 287 | {% endif %} |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 288 | links: |
| 289 | - consul:consul |
| 290 | {% if use_redis %} |
| 291 | - xos_redis:redis |
| 292 | {% endif %} |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 293 | volumes: |
| 294 | - {{ cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro |
| 295 | - {{ cord_dir }}/build/platform-install/credentials/xosadmin@opencord.org:/opt/xos/services/{{ svc.name }}/credentials/xosadmin@opencord.org:ro |
| 296 | - {{ cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro |
| 297 | {% if svc.keypair is defined %} |
| 298 | - {{ cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro |
| 299 | {% endif %} |
| 300 | {% if svc.name == "openstack" %} |
| 301 | - {{ cord_profile_dir }}/images:/opt/xos/images:ro |
| 302 | {% endif %} |
| 303 | logging: |
| 304 | driver: "json-file" |
| 305 | options: |
| 306 | max-size: "1000k" |
| 307 | max-file: "5" |
Matteo Scandolo | 893b3d5 | 2017-05-18 16:59:53 -0700 | [diff] [blame^] | 308 | environment: |
| 309 | SERVICE_NAME: "xos-{{ svc.name }}-synchronizer" |
Andy Bavier | 9e7d54a | 2017-04-17 11:37:02 -0400 | [diff] [blame] | 310 | restart: unless-stopped |
| 311 | |
| 312 | {% endif %} |
| 313 | {% endfor %} |
| 314 | {% endif %} |