services:
  test-integration:
    platform: linux/amd64
    build:
      context: .
      target: test-integration
    environment:
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY
      - AWS_SESSION_TOKEN
      - BASE_QA_OWS_ACCOUNTING_URL
      - BASE_QA_OWS_FEATURES_URL=https://qa-ows-features.theorchard.io
      - DB_CLIENT_DB=art_relations
      - DB_CLIENT_HOST=qa.db.qaorch.com
      - DB_CLIENT_PASS
      - DB_CLIENT_USER
      - SNOWFLAKE_USER
      - SNOWFLAKE_PASSWORD
      - SPLIT_ID_SDK_KEY
    env_file:
      - path: tests/integration/.env
        required: false
    volumes:
      - .:/var/app

  unit-lint:
    platform: linux/amd64
    build:
      context: .
      target: unit-lint
    volumes:
      - .:/var/app

  ows-accounting-dev:
    platform: linux/amd64
    build:
      context: .
      target: dev
    ports:
      - 8888:5000
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5000/hello/"]
      interval: 10s
      timeout: 10s
      retries: 3
    environment:
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY
      - AWS_SESSION_TOKEN
      - AWS_DEFAULT_REGION=us-east-1
      - Environment=dev
    env_file:
      - path: .env
        required: false
    volumes:
      - .:/var/app

  ows-accounting-deploy:
    platform: linux/amd64
    build:
      context: .
      target: deploy
    ports:
      - 8889:8080
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/hello/"]
      interval: 10s
      timeout: 10s
      retries: 3
    environment:
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY
      - AWS_SESSION_TOKEN
      - AWS_DEFAULT_REGION=us-east-1
      - Environment=qa
    env_file:
      - path: .env
        required: false
    volumes:
      - .:/var/app
