Spaces:
Runtime error
Runtime error
File size: 986 Bytes
dcfbaff 023485e dcfbaff 023485e 431b044 d899e9a 431b044 7704533 431b044 ce3db45 7704533 d899e9a dcfbaff 023485e dcfbaff c386436 023485e dcfbaff 023485e dcfbaff 05f909c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# Base image
FROM python:3.9
# Set the working directory in the container
WORKDIR /code
# Set environment variables for writable directories
ENV MPLCONFIGDIR=/tmp/matplotlib_cache
ENV XDG_CACHE_HOME=/tmp/cache
ENV TORCH_HOME=/tmp/cache/torch
# Create necessary directories and set permissions
RUN mkdir -p /.cache/gdown /code/pretrained_models /tmp/cache/torch \
&& chmod -R 777 /.cache /code/pretrained_models /tmp/cache
# Install libGL for OpenCV
RUN apt-get update && apt-get install -y \
libgl1-mesa-glx
# Copy the requirements file into the container at /code
COPY code/requirements.txt /code/
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir --upgrade -r requirements.txt
# Install additional packages
RUN pip install uvicorn torch torchvision numpy>=1.16.5 scipy>=1.3.0 opencv-python gdown Pillow gradio
# Copy the rest of your application's code
COPY . .
# Command to run the application
CMD ["python", "code/demo.py"]
|