class_docstr: The Build Configuration describes how the environment a LightningWork runs in should be set up.
  
  Arguments:
      requirements: List of requirements or list of paths to requirement files. If not passed, they will be
          automatically extracted from a `requirements.txt` if it exists.
      dockerfile: The path to a dockerfile to be used to build your container.
          You need to add those lines to ensure your container works in the cloud.
  
          .. warning:: This feature isn't supported yet, but coming soon.
  
          Example::
  
              WORKDIR /gridai/project
              COPY . .
      image: The base image that the work runs on. This should be a publicly accessible image from a registry that
          doesn't enforce rate limits (such as DockerHub) to pull this image, otherwise your application will not
          start.
class_docstr_tok: ["The","Build","Configuration","describes","how","the","environment","a","LightningWork","runs","in","should","be","set","up",".","Arguments",":","requirements",":","List","of","requirements","or","list","of","paths","to","requirement","files",".","If","not","passed",",","they","will","be","automatically","extracted","from","a","`","requirements.txt","`","if","it","exists",".","dockerfile",":","The","path","to","a","dockerfile","to","be","used","to","build","your","container",".","You","need","to","add","those","lines","to","ensure","your","container","works","in","the","cloud",".","..","warning",":",":","This","feature","is","n't","supported","yet",",","but","coming","soon",".","Example",":",":","WORKDIR","\/gridai\/project","COPY",".",".","image",":","The","base","image","that","the","work","runs","on",".","This","should","be","a","publicly","accessible","image","from","a","registry","that","does","n't","enforce","rate","limits","(","such","as","DockerHub",")","to","pull","this","image",",","otherwise","your","application","will","not","start","."]
code: def _find_dockerfile(
      self, work: "LightningWork", filename: str = "Dockerfile"
  ) -> Optional[str]:
      # 1. Get work file
      file = _get_work_file(work)
      if file is None:
          return None
      # 2. Check for Dockerfile.
      dirname = os.path.dirname(file)
      dockerfile = os.path.join(dirname, filename)
      if os.path.isfile(dockerfile):
          return dockerfile
      return None
  
imports: import inspect
  import os
  import re
  from dataclasses import asdict, dataclass, field
  from pathlib import Path
  from typing import TYPE_CHECKING, Dict, List, Optional, Union
  from typing_extensions import Self
  from lightning.app.utilities.app_helpers import Logger
  from lightning.app.utilities.packaging.cloud_compute import CloudCompute
label_desc: Use image node_id 5 for calling the BuildConfig obj's underlying member method code with example usage: obj._find_dockerfile(work, filename) and returns: None, None, dockerfile