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"]