# Sample ECS Fargate task definition (shape only — replace ACCOUNT/REGION/TAG and IAM roles).
# Register with the AWS CLI JSON form, or convert this YAML to JSON for --cli-input-json.
family: doctranslater-api
networkMode: awsvpc
requiresCompatibilities:
  - FARGATE
cpu: "2048"
memory: "4096"
executionRoleArn: arn:aws:iam::ACCOUNT:role/ecsTaskExecutionRole
taskRoleArn: arn:aws:iam::ACCOUNT:role/doctranslaterTaskRole
containerDefinitions:
  - name: doctranslater-api
    image: ACCOUNT.dkr.ecr.REGION.amazonaws.com/doctranslater-api:TAG
    essential: true
    portMappings:
      - containerPort: 8000
        protocol: tcp
    environment:
      - name: DOCTRANSLATE_API_MAX_CONCURRENT_JOBS
        value: "1"
      - name: DOCTRANSLATE_API_DATA_ROOT
        value: /tmp/doctranslate-api
    healthCheck:
      command:
        - CMD-SHELL
        - python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/v1/health/live', timeout=5).read()"
      interval: 30
      timeout: 5
      retries: 3
      startPeriod: 40
    logConfiguration:
      logDriver: awslogs
      options:
        awslogs-group: /ecs/doctranslater-api
        awslogs-region: REGION
        awslogs-stream-prefix: ecs
