- 更新 build_docker.sh 到新仓库地址 - 仓库: Sanster/lama-cleaner → let5sne/IOPaint - 镜像标签: cwq1913/lama-cleaner → let5sne/iopaint - 项目名称: lama-cleaner → IOPaint - 重构 Dockerfile (CPU & GPU) - 从源码构建替代 PyPI 安装 - 更新基础镜像到最新版本 - CPU: python:3.11-slim-bookworm - GPU: nvidia/cuda:12.1.0-runtime-ubuntu22.04 - 使用最新的 PyTorch 和依赖版本 - 添加自动启动命令 - 更新 scripts/pack.sh - 构建目录: lama-cleaner → iopaint - 修复拼写错误 (Ensuer → Ensure) - 新增 docker/README.md - 完整的 Docker 部署指南 - 包含 CPU 和 GPU 两种模式 - Docker Compose 配置示例 - 故障排查和安全建议 主要改进: - ✨ 与当前项目完全同步 - 📦 支持从源码构建 - 🔧 更灵活的运行配置 - 📝 完整的使用文档 - 🚀 更新的依赖版本 🤖 Generated with Claude Code
30 lines
831 B
Plaintext
30 lines
831 B
Plaintext
FROM python:3.11-slim-bookworm
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
|
software-properties-common \
|
|
libsm6 libxext6 ffmpeg libfontconfig1 libxrender1 libgl1-mesa-glx \
|
|
curl gcc build-essential git \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN pip install --upgrade pip && \
|
|
pip install torch torchvision --index-url https://download.pytorch.org/whl/cpu
|
|
|
|
WORKDIR /app
|
|
|
|
# 复制项目文件
|
|
COPY requirements.txt requirements-dev.txt setup.py main.py ./
|
|
COPY iopaint ./iopaint
|
|
COPY web_app ./web_app
|
|
|
|
# 安装依赖
|
|
RUN pip install -r requirements.txt && \
|
|
pip install -e .
|
|
|
|
# 安装插件依赖
|
|
RUN iopaint install-plugins-packages || true
|
|
|
|
EXPOSE 8080
|
|
|
|
# 默认启动命令
|
|
CMD ["python3", "main.py", "start", "--model", "lama", "--device", "cpu", "--port", "8080", "--host", "0.0.0.0"]
|