xos_db:
    image: xosproject/xos-postgres
    expose:
        - "5432"

xos_synchronizer_openstack:
    command: bash -c "sleep 120; python /opt/xos/synchronizers/openstack/xos-synchronizer.py"
    image: xosproject/xos-synchronizer-openstack
    labels:
        org.xosproject.kind: synchronizer
        org.xosproject.target: openstack
    links:
        - xos_db
    volumes:
        - .:/root/setup:ro
        - ../setup/id_rsa:/opt/xos/configurations/mcord/mcord_private_key:ro  # private key
    extra_hosts:
        - "controller:10.102.81.3"
        - "computeBBU1:10.102.81.6"
        - "computeBBU2:10.102.81.7"
        - "compute9:10.102.81.9"
        - "compute10:10.102.81.10"

xos_synchronizer_vbbu:
    image: xosproject/xos-synchronizer-openstack
    command: bash -c "sleep 120; python /opt/xos/synchronizers/vbbu/vbbu-synchronizer.py -C /opt/xos/synchronizers/vbbu/vbbu_config"
    labels:
        org.xosproject.kind: synchronizer
        org.xosproject.target: vbbu 
    links:
        - xos_db
    volumes:
        - ../setup/id_rsa_mcord:/opt/xos/configurations/mcord/mcord_private_key:ro  # private key
        - ../setup/id_rsa_mcord.pub:/opt/xos/configurations/mcord/mcord_public_key:ro  # public key
        - ../setup:/root/setup:ro
    extra_hosts:
        - "controller:10.102.81.3"
        - "computeBBU1:10.102.81.6"
        - "computeBBU2:10.102.81.7"
        - "compute9:10.102.81.9"
        - "compute10:10.102.81.10"

xos_synchronizer_vpgwc:
    image: xosproject/xos-synchronizer-openstack
    command: bash -c "sleep 120; python /opt/xos/synchronizers/vpgwc/vpgwc-synchronizer.py -C /opt/xos/synchronizers/vpgwc/vpgwc_config"
    labels:
        org.xosproject.kind: synchronizer
        org.xosproject.target: vpgwc 
    links:
        - xos_db
    volumes:
        - ../setup/id_rsa_mcord:/opt/xos/configurations/mcord/mcord_private_key:ro  # private key
        - ../setup/id_rsa_mcord.pub:/opt/xos/configurations/mcord/mcord_public_key:ro  # public key
        - ../setup:/root/setup:ro
    extra_hosts:
        - "controller:10.102.81.3"
        - "computeBBU1:10.102.81.6"
        - "computeBBU2:10.102.81.7"
        - "compute9:10.102.81.9"
        - "compute10:10.102.81.10"

# FUTURE
#xos_swarm_synchronizer:
#    image: xosproject/xos-swarm-synchronizer
#    labels:
#        org.xosproject.kind: synchronizer
#        org.xosproject.target: swarm

xos:
    command: python /opt/xos/manage.py runserver 0.0.0.0:8000 --insecure --makemigrations
    image: xosproject/xos
    links:
        - xos_db
    ports:
        - "8000:8000"
    volumes:
        - .:/root/setup:ro
        - ../setup/id_rsa.pub:/opt/xos/configurations/mcord/mcord_public_key:ro  # private key
