services:

  unit-lint:
    build:
      context: .
      target: unit-lint
    environment:
      - SPLITIO_API_KEY=localhost
      - SPLIT_FILE_PATH=/var/app/tests/.split
    volumes:
      - .:/var/app

  integration-test:
    build:
      context: .
      target: integration-test
    environment:
      - QA_BASE_URL=https://qa-ows-contributor.theorchard.io
      - AWS_ACCESS_KEY_ID
      - AWS_DEFAULT_REGION=us-east-1
      - AWS_SECRET_ACCESS_KEY
      - AWS_SESSION_TOKEN
      - SPLITIO_API_KEY=localhost
      - SPLIT_FILE_PATH=/var/app/tests/.split
    volumes:
      - .:/var/app

  contributor-dev:
    build:
      context: .
      target: dev
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:5000/hello/"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s
    environment:
      - Environment=dev
      - DD_ENV=dev
      - DD_SERVICE=ows-contributor
      - DD_AGENT_HOST=dev-datadog-agent.dev.theorchard.io
      - DD_TRACE_ENABLED=1
      - DD_PROFILING_ENABLED=1
      - SPLITIO_API_KEY=localhost
      - SPLIT_FILE_PATH=/var/app/tests/.split
    volumes:
      - .:/var/app

  contributor-deploy:
    build:
      context: .
      target: deploy
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:8080/hello/"]
      interval: 1m30s
      timeout: 10s
      retries: 3
      start_period: 40s
    environment:
      - Environment=dev
      - DD_ENV=dev
      - DD_SERVICE=ows-contributor
      - DD_AGENT_HOST=dev-datadog-agent.dev.theorchard.io
      - DD_TRACE_ENABLED=1
      - DD_PROFILING_ENABLED=1
      - SPLITIO_API_KEY
      - SPLIT_FILE_PATH

  uv-lock-upgrade:
    image: ghcr.io/astral-sh/uv:python3.14-alpine
    working_dir: /var/app
    command: uv lock --upgrade
    volumes:
      - .:/var/app
