services:
  api:
    image: ${REGISTRY}/${PROJECT_PATH}/api:${TAG}
    deploy:
      endpoint_mode: dnsrr
      mode: replicated
      replicas: 1
      update_config:
        parallelism: 1
        delay: 10s
        failure_action: rollback
      restart_policy:
        condition: on-failure
        delay: 5s
        max_attempts: 3
    environment:
      - FR_GALLERY_EMBEDDING_PATH=${FR_GALLERY_EMBEDDING_PATH:-}
      - FR_FD_ONNX_PATH=${FR_FD_ONNX_PATH:-}
      - FR_FR_ONNX_PATH=${FR_FR_ONNX_PATH:-}
      - FR_DETECTOR_THRESHOLD=${FR_DETECTOR_THRESHOLD:-0.7}
      - FR_TRACK_MIN_FACE_SIZE=${FR_TRACK_MIN_FACE_SIZE:-30}
      - FR_TRACK_AGGREGATION_STRATEGY=${FR_TRACK_AGGREGATION_STRATEGY:-embedding}
      - FR_DEBUG=${FR_DEBUG:-false}
    networks:
      - tyk

networks:
  tyk:
    external: true
