blob: fe1616183746e7c615e540c15886dabb622ebc7f [file] [log] [blame]
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:
consul:
image: {{ deploy_docker_registry }}gliderlabs/consul-server:{{ deploy_docker_tag }}
command: "-advertise=${MYHOST} -server -bootstrap"
ports:
- "127.0.0.1:8500:8500"
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
environment:
SERVICE_8300_IGNORE: "yes"
SERVICE_8301_IGNORE: "yes"
SERVICE_8302_IGNORE: "yes"
SERVICE_8400_IGNORE: "yes"
SERVICE_8500_NAME: "consul-rest"
SERVICE_8600_IGNORE: "yes"
restart: unless-stopped
registrator:
image: {{ deploy_docker_registry }}gliderlabs/registrator:{{ deploy_docker_tag }}
command: [
"-ip=${DOCKER_HOST_IP}",
"-internal",
"-retry-attempts", "100",
"consul://consul:8500"
]
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
links:
- consul
volumes:
- /var/run/docker.sock:/tmp/docker.sock
depends_on:
- consul
restart: unless-stopped
xos_db:
image: {{ deploy_docker_registry }}xosproject/xos-postgres:{{ deploy_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
expose:
- "5432"
depends_on:
- registrator
environment:
SERVICE_5432_NAME: "xos-db"
restart: unless-stopped
{% if use_redis %}
xos_redis:
image: {{ deploy_docker_registry }}redis:{{ deploy_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
depends_on:
- registrator
environment:
SERVICE_NAME: "redis"
restart: unless-stopped
{% endif %}
xos_gui:
image: {{ deploy_docker_registry }}xosproject/xos-gui:{{ deploy_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"
depends_on:
- registrator
environment:
SERVICE_4000_NAME: "xos-gui"
SERVICE_80_IGNORE: "yes"
restart: unless-stopped
xos_chameleon:
image: {{ deploy_docker_registry }}xosproject/chameleon:{{ deploy_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
ports:
- "9101:9101"
links:
- xos_core:xos-core
depends_on:
- xos_core
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
depends_on:
- registrator
environment:
SERVICE_9101_NAME: "xos-rest"
restart: unless-stopped
gui_extensions_store:
image: {{ deploy_docker_registry }}node:7.9.0
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"
depends_on:
- registrator
xos_ws:
image: {{ deploy_docker_registry }}xosproject/xos-ws:{{ deploy_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
command: npm start -- --config gateway-config.yml
ports:
- "3000:3000"
links:
- xos_ui:xos
{% if use_redis %}
- xos_redis:redis
{% endif %}
depends_on:
- xos_ui
{% 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"
depends_on:
- registrator
environment:
SERVICE_3000_NAME: "xos-ws"
restart: unless-stopped
xos_ui:
image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
command: python /opt/xos/manage.py runserver 0.0.0.0:9000 --insecure --makemigrations
ports:
- "9000:9000"
links:
- xos_db:xos_db
- consul:consul
{% 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 }}:/opt/cord_profile:ro
- {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
- {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
depends_on:
- registrator
environment:
SERVICE_9000_NAME: "xos-ui-deprecated"
restart: unless-stopped
xos_core:
image: {{ deploy_docker_registry }}xosproject/xos-ui:{{ deploy_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
command: bash -c "cd coreapi; bash ./start_coreapi.sh"
ports:
- "50051:50051"
- "50055:50055"
links:
- xos_db:xos_db
- consul:consul
{% if use_redis %}
- xos_redis:redis
{% endif %}
depends_on:
- xos_db
- registrator
{% if use_redis %}
- xos_redis
{% endif %}
volumes:
- {{ head_cord_profile_dir }}/xos_config.yaml:/opt/xos/xos_config.yaml:ro
- {{ head_cord_profile_dir }}:/opt/cord_profile:ro
- {{ head_cord_dir }}/orchestration/xos_libraries/ng-xos-lib:/opt/xos_libraries/ng-xos-lib:ro
- {{ head_cord_profile_dir }}/im_cert_chain.pem:/usr/local/share/ca-certificates/local_certs.crt:ro
- /var/run/docker.sock:/var/run/docker.sock
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
environment:
SERVICE_50051_NAME: "xos-grpc-secure"
SERVICE_50055_NAME: "xos-grpc-insecure"
restart: unless-stopped
{% for ext in enabled_gui_extensions %}
gui-extension-{{ ext.name }}:
image: {{ deploy_docker_registry }}xosproject/gui-extension-{{ ext.name }}:{{ deploy_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
command: npm run build
volumes_from:
- gui_extensions_store
logging:
driver: "json-file"
options:
max-size: "1000k"
max-file: "5"
depends_on:
- registrator
{% endfor %}
{% if not frontend_only %}
{% for svc in xos_services %}
{% if svc.synchronizer is not defined or svc.synchronizer %}
{{ svc.name }}-synchronizer:
image: {{ deploy_docker_registry }}xosproject/{{ svc.name }}-synchronizer:{{ deploy_docker_tag }}
networks:
{% for network in xos_docker_networks %}
- {{ network }}
{% endfor %}
depends_on:
- registrator
{% if use_redis %}
- xos_redis
{% endif %}
links:
- consul:consul
{% if use_redis %}
- xos_redis:redis
{% endif %}
volumes:
- {{ head_cord_profile_dir }}/node_key:/opt/cord_profile/node_key:ro
- /opt/credentials:/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"
environment:
SERVICE_NAME: "xos-{{ svc.name }}-synchronizer"
restart: unless-stopped
{% endif %}
{% endfor %}
{% endif %}