FROM python:3.9 RUN apt update && apt install -y libgl1-mesa-glx USER root COPY . . ##安装imagemagic ,linux使用convert路径即可 RUN apt install -y imagemagick ENV IMAGEMAGICK_BINARY=/usr/bin/convert #这条命令成效显著 RUN sed -i 's/none/read,write/g' /etc/ImageMagick-6/policy.xml 就是这个原因说unrecogize format #RUN sed -i 's/none/read,write/g' /etc/ImageMagick-6/policy.xml #自定义policy防止限制 RUN cp -f ./custom-imagemagick-policy.yml /etc/ImageMagick-6/policy.xml RUN sed -i 's/none/read,write/g' /etc/ImageMagick-6/policy.xml ##安装imagemagic RUN pip install -U pip RUN pip install -r requirements.txt # 更改文件夹权限 -保存视频,漫画,漫画去印1,漫画裁剪12,裁剪识别合并->output RUN mkdir output RUN chmod -R 777 /output RUN mkdir -m 777 -p manga manga1 manga12 #给mp3临时输出文件权限 RUN mkdir -m 777 -p mp3_out #给mp4输出文件权限,当前目录下有很多目录给不了权限,只能创建一个给 RUN mkdir -m 777 -p mp4_out #封面保存权限 RUN mkdir -m 777 -p cover EXPOSE 7860 #server.py CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]