Spaces:
Sleeping
Sleeping
| FROM python:3.10-slim-bookworm | |
| WORKDIR /app | |
| # --- Install System Libs --- | |
| # 1. Add 'git' (to install from the git repo) | |
| # 2. Add the "kitchen sink" libs to support full 'opencv-python' | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| git \ | |
| libgl1 \ | |
| libglx-mesa0 \ | |
| libglib2.0-0 \ | |
| libsm6 \ | |
| libxext6 \ | |
| libxrender1 \ | |
| libgtk-3-0 \ | |
| libgomp1 \ | |
| libtbbmalloc2 \ | |
| libavcodec59 \ | |
| libavformat59 \ | |
| libswscale6 \ | |
| libv4l-0 \ | |
| libv4lconvert0 \ | |
| libjpeg62-turbo \ | |
| libpng16-16 \ | |
| libtiff6 \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| # --- Mimic Gradio Install --- | |
| RUN pip install --no-cache-dir --upgrade pip \ | |
| \ | |
| # 1. Install all dependencies from requirements.txt | |
| && pip install --no-cache-dir -r requirements.txt \ | |
| \ | |
| # 2. Install RealESRGAN from the git fork with --no-deps | |
| # (This is the critical step from the Gradio demo) | |
| && pip install --no-cache-dir git+https://github.com/inference-sh/Real-ESRGAN.git --no-deps | |
| # Copy the new app logic | |
| COPY app_realesrgan.py . | |
| # Writable models directory | |
| RUN mkdir -p /app/models && chmod 777 /app/models | |
| EXPOSE 7860 | |
| CMD ["uvicorn", "app_realesrgan:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] |