aspects-job:
  user: root
  image: {{ DOCKER_IMAGE_ASPECTS }}
  environment:
    - XAPI_SCHEMA={{ ASPECTS_XAPI_DATABASE }}
    - ASPECTS_ENROLLMENT_EVENTS_TABLE={{ ASPECTS_ENROLLMENT_EVENTS_TABLE }}
  volumes:
    - ../../env/plugins/aspects/apps/aspects:/app/aspects
    - ../../env/plugins/aspects/apps/aspects/scripts/:/app/aspects/scripts:ro
  {% if RUN_SUPERSET or RUN_CLICKHOUSE or RUN_RALPH %}depends_on:{% if RUN_SUPERSET %}
    - superset{% endif %}{% if RUN_CLICKHOUSE%}
    - clickhouse{% endif %}{% if RUN_RALPH %}
    - ralph{% endif %}
  {% endif %}
clickhouse-job:
    image: {{DOCKER_IMAGE_CLICKHOUSE}}
    {% if RUN_CLICKHOUSE%}depends_on:
        - clickhouse
    {% endif %}

{% if RUN_SUPERSET %}
superset-job:
  {% include 'base-docker-compose-services' %}
    OPENEDX_LMS_ROOT_URL: "{% if ENABLE_HTTPS %}https{% else %}http{% endif %}://{{ LMS_HOST }}"
    OAUTH2_CLIENT_ID: {{ SUPERSET_OAUTH2_CLIENT_ID }}
  depends_on:
    - mysql
    - redis
    - superset
{% endif %}
