blob: a3f817b0e30cf451314570d7d73e26a812fb7cb5 [file] [log] [blame]
---
{#
Copyright 2017-present Open Networking Foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
#}
version: '2'
# XOS docker compose
# generated by cord-profile/templates/docker-compose.yml.j2
networks:
{% for network in xos_docker_networks %}
{{ network }}:
external: true
{% endfor %}
services:
{% if use_elasticstack %}
elk:
image: {{ pull_docker_registry }}sebp/elk:{{ pull_docker_tag }}
ports:
- "5601:5601"
- "9200:9200"
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
{% endif %}
xos_db:
image: {{ pull_docker_registry }}postgres:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
environment:
- POSTGRES_DB={{ xos_db_name }}
- POSTGRES_USER={{ xos_db_username }}
- POSTGRES_PASSWORD={{ xos_db_password }}
expose:
- "5432"
restart: unless-stopped
{% if use_redis %}
xos_redis:
image: {{ pull_docker_registry }}redis:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
restart: unless-stopped
{% endif %}
xos_gui:
image: {{ pull_docker_registry }}xosproject/xos-gui:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
ports:
- "4000:4000"
links:
- xos_ws:xos-ws
- xos_chameleon:xos-chameleon
depends_on:
- xos_ws
- xos_chameleon
volumes:
- {{ head_cord_profile_dir }}/style.config.js:/var/www/dist/style.config.js
- {{ head_cord_profile_dir }}/app.config.js:/var/www/dist/app.config.js
volumes_from:
- gui_extensions_store
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
restart: unless-stopped
xos_tosca:
image: {{ pull_docker_registry }}xosproject/xos-tosca:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
ports:
- "9102:9102"
links:
- xos_core:xos-core
volumes:
- {{ head_cord_profile_dir }}/xos-tosca.config.yaml:/opt/xos-tosca/src/xos-tosca.config.yaml
- {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
depends_on:
- xos_core
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
restart: unless-stopped
xos_chameleon:
image: {{ pull_docker_registry }}xosproject/chameleon:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
command: python chameleon/chameleon/main.py -R 9101 -G xos-core:50055 --swagger-url /apidocs -r
ports:
- "9101:9101"
links:
- xos_core:xos-core
depends_on:
- xos_core
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
restart: unless-stopped
gui_extensions_store:
image: {{ pull_docker_registry }}node:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
command: /bin/true
volumes:
- /var/www/dist/extensions
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
xos_ws:
image: {{ pull_docker_registry }}xosproject/xos-ws:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
command: npm start -- --config gateway-config.yml
ports:
- "3000:3000"
links:
{% if use_redis %}
- xos_redis:redis
{% endif %}
depends_on:
- xos_core
{% if use_redis %}
- xos_redis
{% endif %}
volumes:
- {{ head_cord_profile_dir }}/gateway-config.yml:/var/www/src/config/gateway-config.yml
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
restart: unless-stopped
xos_core:
image: {{ pull_docker_registry }}xosproject/xos-core:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
command: bash -c "service filebeat start; cd coreapi; bash ./start_coreapi.sh"
ports:
- "50051:50051"
- "50055:50055"
links:
- xos_db:xos-db
{% if use_redis %}
- xos_redis:redis
{% endif %}
depends_on:
- xos_db
{% if use_redis %}
- xos_redis
{% endif %}
volumes:
- {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
- {{ head_cord_profile_dir }}/core_api_cert.pem:/opt/cord_profile/core_api_cert.pem:ro
- {{ head_cord_profile_dir }}/core_api_key.pem:/opt/cord_profile/core_api_key.pem:ro
- {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
- {{ head_cord_profile_dir }}/initial_data.yaml:/opt/xos/core/migrations/initial_data.yaml:ro
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
restart: unless-stopped
{% for ext in enabled_gui_extensions %}
gui-extension-{{ ext.name }}:
image: {{ pull_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
command: /bin/sh -c "mkdir -p /var/www/dist/extensions/{{ ext.name }}/ && cp -R /tmp/* /var/www/dist/extensions/{{ ext.name }}/"
volumes_from:
- gui_extensions_store
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
{% endfor %}
{% for svc in xos_services %}
{% if svc.synchronizer is not defined or svc.synchronizer %}
{{ svc.name }}-synchronizer:
image: {{ pull_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ pull_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
{% if use_redis %}
depends_on:
- xos_redis
{% endif %}
links:
- xos_core:xos-core
{% if use_redis %}
- xos_redis:redis
{% endif %}
volumes:
- {{ head_cord_profile_dir }}/xos_config_synchronizer.yaml:/opt/xos/xos_config.yaml:ro
- {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
- {{ head_credentials_dir }}:/opt/xos/services/{{ svc.name }}/credentials:ro
- {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
{% if svc.keypair is defined %}
- {{ head_cord_profile_dir }}/key_import/{{ svc.keypair }}:/opt/xos/services/{{ svc.name }}/keys/{{ svc.keypair }}:ro
{% endif %}
{% if svc.name == "openstack" %}
- {{ head_cord_profile_dir }}/images:/opt/xos/images:ro
{% endif %}
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
restart: on-failure
{% endif %}
{% endfor %}