File size: 1,629 Bytes
555754c
 
 
b03bc89
 
 
75d88a8
 
555754c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a54736a
555754c
 
20588a8
555754c
 
d8cf71e
555754c
8c69e8b
 
555754c
9efdcd0
555754c
 
 
 
 
a4d092c
 
 
555754c
a4d092c
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Use an official PyTorch image with CUDA support as the base image
FROM pytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtime

# Install Git and system libraries required for OpenGL without interactive prompts
ENV DEBIAN_FRONTEND=noninteractive

# Install Git and OpenGL libraries, and libglib2.0
RUN apt-get update && apt-get install -y git libgl1-mesa-glx libglib2.0-0

# Set up a new user named "user" with user ID 1000
RUN useradd -m -u 1000 user

# Switch to the "user" user
USER user

ENV HOME=/home/user \
	PATH=/home/user/.local/bin:$PATH \
    PYTHONPATH=$HOME/app \
	PYTHONUNBUFFERED=1 \
	GRADIO_ALLOW_FLAGGING=never \
	GRADIO_NUM_PORTS=1 \
	GRADIO_SERVER_NAME=0.0.0.0 \
	GRADIO_THEME=huggingface \
    GRADIO_SHARE=False \
	SYSTEM=spaces

# Set the working directory to the user's home directory
WORKDIR $HOME/app

# Clone your repository or add your code to the container
RUN git clone -b main https://github.com/fffiloni/daclip-uir $HOME/app

# Install dependencies
RUN pip install --no-cache-dir -r requirements.txt gradio

# Copy the pretrained file and folder into the working directory
COPY pretrained_daclip_uir/ $HOME/app/universal-image-restoration/config/daclip-sde/pretrained/

RUN find $HOME/app

# Set the working directory to the app.py file's location
#WORKDIR $HOME/app/universal-image-restoration/config/daclip-sde/

# Set the environment variable to specify the GPU device
ENV CUDA_DEVICE_ORDER=PCI_BUS_ID
ENV CUDA_VISIBLE_DEVICES=0

# Set the working directory to the user's home directory
WORKDIR $HOME/app/universal-image-restoration/config/daclip-sde/

# Run your app.py script
CMD ["python", "app.py"]