{% include 'roles/docker-compose/templates/base.yml.j2' %}
  litellm:
{% set service_name = 'litellm' %}
{% include 'roles/docker-container/templates/base.yml.j2' %}
    image: {{ FLOWISE_LITELLM_IMAGE }}:{{ FLOWISE_LITELLM_VERSION }}
    container_name: {{ FLOWISE_LITELLM_CONTAINER }}
    expose:
      - {{ FLOWISE_LITELLM_PORT }}
    volumes:
      - {{ FLOWISE_LITELLM_CONFIG_PATH_HOST }}:{{ FLOWISE_LITELLM_CONFIG_PATH_DOCKER }}:ro
    command: >
      --host 0.0.0.0
      --port {{ FLOWISE_LITELLM_PORT }}
      --config {{ FLOWISE_LITELLM_CONFIG_PATH_DOCKER }}
{% include 'roles/docker-container/templates/networks.yml.j2' %}

  qdrant:
{% set service_name = 'qdrant' %}
{% include 'roles/docker-container/templates/base.yml.j2' %}
    image: {{ FLOWISE_QDRANT_IMAGE }}:{{ FLOWISE_QDRANT_VERSION }}
    container_name: {{ FLOWISE_QDRANT_CONTAINER }}
    ports:
      - {{ FLOWISE_QDRANT_HTTP_PORT }}
      - {{ FLOWISE_QDRANT_GRPC_PORT }}
    volumes:
      - qdrant_data:/qdrant/storage
{% include 'roles/docker-container/templates/networks.yml.j2' %}

  flowise:
{% set service_name = 'flowise' %}
{% include 'roles/docker-container/templates/base.yml.j2' %}
    image: {{ FLOWISE_IMAGE }}:{{ FLOWISE_VERSION }}
    container_name: {{ FLOWISE_CONTAINER }}
    depends_on: 
      - qdrant
      - litellm
    ports:
      - "127.0.0.1:{{ FLOWISE_PORT_PUBLIC }}:{{ FLOWISE_PORT_INTERNAL }}"
    volumes:
      - flowise_data:/root/.flowise
{% include 'roles/docker-container/templates/networks.yml.j2' %}

{% include 'roles/docker-compose/templates/networks.yml.j2' %}

{% include 'roles/docker-compose/templates/volumes.yml.j2' %}
  qdrant_data:
    name: {{ FLOWISE_QDRANT_VOLUME }}
  flowise_data:
    name: {{ FLOWISE_VOLUME }}
