x-templates:
  # `x-templates` field contains reusable templates for metadata extraction services that user can define under `services` field.
  # See docker-compose docs on re-using configuration fragments: https://docs.docker.com/compose/compose-file/compose-file-v3/#extension-fields
  looker: &looker-defaults # Looker default environment variables
    OUTPUT_PREFIX: /output
    PRIVATE_KEY_PATH: /run/secrets/looker_git_private_key
    PRIVATE_KEY_PASSPHRASE_PATH: /run/secrets/looker_git_private_key_passphrase
    LOOKER_CONFIG: /run/secrets/looker_config
  extract-looker-service: &extract
    image: looker-extractor-master
    command:
      - "python"
      - "-m"
      - "marketplace_scripts.looker_v2.extract"
    privileged: false
    network_mode: host
    environment:
      <<: *looker-defaults
    secrets:
      - looker_git_private_key
      - looker_config
      - looker_git_private_key_passphrase


# Create a separate service for each looker connection:
services:
  # Example Looker connection
  looker-example:
    <<: *extract
    environment:
      <<: *looker-defaults
      # Change INCLUDE_PROJECTS value to a comma-separated
      # list of Looker projects you want to crawl
      INCLUDE_PROJECTS: "my-project,my-other-project"
      USE_FIELD_LEVEL_LINEAGE: "true"
    volumes:
      # You can change './output/looker-example' to any output location you want
      - ./output/looker-example:/output/process


secrets:
  looker_config:
    # Change it to the actual location of your looker.ini file
    file: ./looker.ini
  looker_git_private_key:
    # Change it to the actual location of your git private key file
    file: ./id_ed25519
  looker_git_private_key_passphrase:
    # Change it to the actual path of the file containing
    # the private key passphrase (the file might be empty).
    file: ./passphrase.txt
