File size: 1,169 Bytes
601fac8 376ed8c 44adc57 4125ecd 601fac8 454b7dc d24f3fe 1ba1ce3 4bd774d 601fac8 55fcf06 601fac8 5f0c24c 601fac8 5f0c24c 44adc57 5f0c24c 1ba1ce3 a64e0af 2f85ded f4a22de 6af9ed5 5f0c24c 601fac8 5f0c24c 601fac8 0c59880 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
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"]
|