IOPaint / Dockerfile
tom12112's picture
Update Dockerfile
a6a3c65 verified
raw
history blame contribute delete
711 Bytes
FROM python:3.10
# 安装系统依赖和 nodejs/npm
RUN apt-get update && apt-get install -y ffmpeg libsm6 libxext6 libgl1-mesa-glx git nodejs npm
# 复制全部代码
COPY . /app
WORKDIR /app
# 安装 Python 依赖
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# 构建前端
WORKDIR /app/web_app
RUN npm install && npm run build
# 拷贝前端构建产物到后端
RUN mkdir -p /app/iopaint/web_app && cp -r dist/* /app/iopaint/web_app/
# 回到后端工作目录
WORKDIR /app
# 设置缓存目录
ENV XDG_CACHE_HOME=/tmp/.cache
ENV PORT 7860
# 启动命令
CMD ["python3", "main.py", "start", "--model", "lama", "--port", "7860", "--host", "0.0.0.0", "--model-dir", "/tmp/models"]