Spaces:
Running
Running
| 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"] | |