FROM python:3.9 WORKDIR /app # Copy the current directory contents into the container at /app COPY . /app RUN pip install --no-cache-dir -r requirements.txt RUN apt-get update && apt-get install -y libgl1-mesa-glx # Command to modify the file before app startup RUN sed -i 's/from torchvision.transforms.functional_tensor import rgb_to_grayscale/from torchvision.transforms.functional import rgb_to_grayscale/' /usr/local/lib/python3.9/site-packages/basicsr/data/degradations.py # Make port 80 available to the world outside this container EXPOSE 7860 # Run app.py when the container launches CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]