---
services:
  function:
    platform: linux/amd64
    build:
      context: .
    volumes:
      - ./src:/var/task/src
      - ./constants:/var/task/constants
    ports:
      - "9000:8080"
    environment:
      - DD_ENV=dev
      - DD_SERVICE=image-encoding
      - DD_TRACE_ENABLED=false
      - DD_ENHANCED_METRICS=false
      - Environment=qa
      - PREVIEW_OUTPUT_BUCKET_NAME=qa-asset-storage
      - OUTPUT_BUCKET_NAME=qa-orcd-mezzanine-assets
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY
      - AWS_SESSION_TOKEN
      - AWS_REGION
      - AWS_DEFAULT_REGION
      - EXPECTED_BUCKET_OWNER=437795906767
    deploy:
      resources:
        limits:
          # https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html
          # You can increase or decrease the memory and CPU power allocated to
          # your function using the Memory setting. You can configure memory
          # between 128 MB and 10,240 MB in 1-MB increments. At 1,769 MB, a
          # function has the equivalent of one vCPU (one vCPU-second of
          # credits per second).
          memory: 3072M
          cpus: '1.737'
  lint-and-test:
    platform: linux/amd64
    build:
      context: .
      dockerfile: Dockerfile.tests
    environment:
      - SKIP_LINT=0
      - TEST_ARGS=-v
      - COV_REPORT=term
