services:
  dev:
    build:
      context: .
      target: dev
    environment:
      - Environment=dev
      - AR_DB_HOST
      - AR_DB_PASSWORD
      - AR_DB_USERNAME
      - LOGGER_LEVEL=${LOGGER_LEVEL:-INFO}
      - AWS_REGION
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY
      - AWS_SESSION_TOKEN
    ports:
      - "5000:5000"

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

  integration:
    build:
      context: .
      target: integration
    environment:
      - BASE_QA_GRASS_URL=https://qa-ows-grass.theorchard.io
      - QA_GRASS_HOST=https://api-dev.theorchard.io/auth/session
      - QA_DB_HOST=qadb01.qaorch.com
      - BASE_QA_URL=https://qa-ows-features.theorchard.io
      - QA_DB_DATABASE=art_relations
      - QA_DB_USER
      - QA_DB_PASS

  deploy:
    build:
      context: .
      target: deploy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/hello/"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s
