services:
  service:
    platform: linux/amd64
    build:
      context: .
      target: dev
      args:
        DOCKER_BUILDKIT: 1
      secrets:
        - GITHUB_NPM_TOKEN
    environment:
      - GITHUB_NPM_TOKEN=/run/secrets/GITHUB_NPM_TOKEN
      - ENV=qa
      - PORT=8080
      - NODE_ENV=dev
      - INTROSPECTION=1
      - PLAYGROUND=1
      - APOLLO_ENGINE_API_KEY
      - APOLLO_ENGINE_SCHEMA_TAG=qa
      - MANAGED=true
      - AUTH0_DOMAIN=qa-orchard.auth0.com
      - AUTH_ISSUERS='https://qalogin.theorchard.com/, https://qa-orchard.auth0.com/'
      - DD_TRACE_ENABLED=false
      - LOG_LEVEL=info
      - GRAPHQL_ABACUS_URL=https://qa-graphql-abacus.theorchard.io/graphql
      - GRAPHQL_ACCOUNT_URL=https://qa-graphql-account.theorchard.io/graphql
      - GRAPHQL_ANALYTICS_URL=https://qa-graphql-analytics.theorchard.io/graphql
      - GRAPHQL_AUDIENCE_URL=https://qa-graphql-audience.theorchard.io/graphql
      - GRAPHQL_COLLABORATOR_URL=https://qa-graphql-collaborator.theorchard.io/graphql
      - GRAPHQL_CONTENT_REVIEW_URL=https://qa-graphql-content-review.theorchard.io/graphql
      - GRAPHQL_DISTRIBUTION_URL:https://qa-graphql-distribution.theorchard.io/graphql
      - GRAPHQL_KNOWLEDGE_SEARCH_URL=https://qa-graphql-knowledge-search.theorchard.io/graphql
      - GRAPHQL_KNOWLEDGE_URL=https://qa-graphql-knowledge.theorchard.io/graphql
      - GRAPHQL_NEIGHBOURING_RIGHTS_URL=https://qa-graphql-neighbouring-rights.theorchard.io/graphql
      - GRAPHQL_PARTICIPANT_URL=https://qa-graphql-participant.theorchard.io/graphql
      - GRAPHQL_PODCAST_URL=https://qa-graphql-podcast.theorchard.io/graphql/
      - GRAPHQL_PRODUCT_URL=https://qa-graphql-product.theorchard.io/graphql
      - GRAPHQL_PUBLISHING_URL=https://qa-graphql-publishing.theorchard.io/graphql
      - GRAPHQL_SR_DELIVERY_URL=https://qa-graphql-sr-delivery.theorchard.io/graphql
      - GRAPHQL_TAX_PAYMENT_URL:https://qa-graphql-tax-payment.theorchard.io/graphql
      - GRAPHQL_USER_URL=https://qa-graphql-user.theorchard.io/graphql
    container_name: graphql-gateway
    ports:
      - '8080:8080'
    volumes:
      - ./src:/var/app/src
  service-deploy:
    platform: linux/amd64
    build:
      context: .
      target: deploy
      args:
        DOCKER_BUILDKIT: 1
      secrets:
        - GITHUB_NPM_TOKEN
    environment:
      - GITHUB_NPM_TOKEN=/run/secrets/GITHUB_NPM_TOKEN
      - ENV=qa
      - PORT=8080
      - NODE_ENV=dev
      - INTROSPECTION=true
      - PLAYGROUND=true
      - APOLLO_ENGINE_API_KEY
      - APOLLO_ENGINE_SCHEMA_TAG=qa
      - AUTH0_DOMAIN=qa-orchard.auth0.com
      - AUTH_ISSUERS='https://qalogin.theorchard.com/, https://qa-orchard.auth0.com/'
      - DD_TRACE_ENABLED=false
      - LOG_LEVEL=info
      - GRAPHQL_ABACUS_URL=https://qa-graphql-abacus.theorchard.io/graphql
      - GRAPHQL_ACCOUNT_URL=https://qa-graphql-account.theorchard.io/graphql
      - GRAPHQL_ANALYTICS_URL=https://qa-graphql-analytics.theorchard.io/graphql
      - GRAPHQL_AUDIENCE_URL=https://qa-graphql-audience.theorchard.io/graphql
      - GRAPHQL_COLLABORATOR_URL=https://qa-graphql-collaborator.theorchard.io/graphql
      - GRAPHQL_CONTENT_REVIEW_URL=https://qa-graphql-content-review.theorchard.io/graphql
      - GRAPHQL_DISTRIBUTION_URL:https://qa-graphql-distribution.theorchard.io/graphql
      - GRAPHQL_KNOWLEDGE_SEARCH_URL=https://qa-graphql-knowledge-search.theorchard.io/graphql
      - GRAPHQL_KNOWLEDGE_URL=https://qa-graphql-knowledge.theorchard.io/graphql
      - GRAPHQL_NEIGHBOURING_RIGHTS_URL=https://qa-graphql-neighbouring-rights.theorchard.io/graphql
      - GRAPHQL_PARTICIPANT_URL=https://qa-graphql-participant.theorchard.io/graphql
      - GRAPHQL_PODCAST_URL=https://qa-graphql-podcast.theorchard.io/graphql/
      - GRAPHQL_PRODUCT_URL=https://qa-graphql-product.theorchard.io/graphql
      - GRAPHQL_PUBLISHING_URL=https://qa-graphql-publishing.theorchard.io/graphql
      - GRAPHQL_SR_DELIVERY_URL=https://qa-graphql-sr-delivery.theorchard.io/graphql
      - GRAPHQL_TAX_PAYMENT_URL:https://qa-graphql-tax-payment.theorchard.io/graphql
      - GRAPHQL_USER_URL=https://qa-graphql-user.theorchard.io/graphql
    container_name: graphql-abacus-deploy
    ports:
      - '8081:8080'
  lint-and-test:
    build:
      context: .
      target: lint-and-test
      args:
        - DOCKER_BUILDKIT=1
      secrets:
        - GITHUB_NPM_TOKEN
    environment:
      - NODE_ENV=test
      - ENV=dev
      - GITHUB_NPM_TOKEN=/run/secrets/GITHUB_NPM_TOKEN
  integration-tests:
    build:
      context: .
      target: integration-tests
      args:
        - DOCKER_BUILDKIT=1
      secrets:
        - GITHUB_NPM_TOKEN
    environment:
      - NODE_ENV=test
      - ENV=dev
      - GITHUB_NPM_TOKEN=/run/secrets/GITHUB_NPM_TOKEN
      - BASE_URL=https://qa-graphql-gateway.theorchard.io/graphql
secrets:
  GITHUB_NPM_TOKEN:
    environment: 'GITHUB_NPM_TOKEN'
