File size: 865 Bytes
adf2fff
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
FROM pytorch/pytorch:1.13.1-cuda11.6-cudnn8-devel

WORKDIR /code

# Install system dependencies
RUN apt-get update && apt-get install -y \

    libgl1 \
    libglib2.0-0 \
    git \
    ninja-build \
    && rm -rf /var/lib/apt/lists/*

# Copy requirements
COPY requirements.txt .

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

# Copy application code
COPY . .

# Create necessary directories and set permissions
RUN mkdir -p weights inputs output static && \

    chmod 777 weights inputs output static

# Install basicsr (build extensions in-place)
RUN python basicsr/setup.py build_ext --inplace

# Create a non-root user and switch to it
RUN useradd -m -u 1000 user
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

WORKDIR /code

EXPOSE 7860

CMD ["python", "app.py"]