---
services:
  fmt:
    platform: linux/amd64
    build:
      context: .
      target: unit-lint
    volumes:
      - ./src:/var/task/src
      - ./tests:/var/task/tests
    entrypoint: []
    command:
      - sh
      - -c
      - "ruff check src tests --fix && ruff format src tests"
  unit-lint:
    platform: linux/amd64
    build:
      context: .
      target: unit-lint
    volumes:
      - ./src:/var/task/src
      - ./tests:/var/task/tests
    environment:
      SKIP_LINT: 0
      SKIP_TYPE_CHECKS: 0
      SKIP_TESTS: 0
      TEST_ARGS: -v
      SKIP_COV: 0
    entrypoint: []
    command: ./lint-and-test.sh
  lockfile:
    platform: linux/amd64
    build:
      context: .
      target: base
    entrypoint: []
    command: ["poetry", "update"]
    volumes:
      - ./pyproject.toml:/var/task/pyproject.toml
      - ./poetry.lock:/var/task/poetry.lock
  function:
    platform: linux/amd64
    build:
      context: .
      target: deploy
    volumes:
      - ./src:/var/task/src
    ports:
      - "9000:8080"
    environment:
      EFS_PATH: /mnt/efs
      EFS_RETENTION_DAYS: 7
      DD_ENV: dev
      DD_SERVICE: cleanup-efs
      DD_TRACE_ENABLED: false
      DD_ENHANCED_METRICS: false
