24 lines
543 B
Plaintext
24 lines
543 B
Plaintext
|
# 使用预先构建的Blender镜像
|
||
|
FROM zocker160/blender-bpy:stable
|
||
|
|
||
|
# 安装Python库和工具
|
||
|
RUN apt-get update && apt-get install -y \
|
||
|
python3-pip
|
||
|
|
||
|
# 安装Python依赖
|
||
|
RUN pip3 install fastapi uvicorn python-multipart
|
||
|
|
||
|
# 设置工作目录
|
||
|
WORKDIR /workspace
|
||
|
|
||
|
RUN mkdir /workspace/temp
|
||
|
|
||
|
# 复制API和处理脚本到容器内
|
||
|
COPY ./api_script.py /workspace/
|
||
|
COPY ./add_thickness.py /workspace/
|
||
|
|
||
|
# 暴露FastAPI使用的端口
|
||
|
EXPOSE 8000
|
||
|
|
||
|
# 设置启动命令
|
||
|
CMD ["uvicorn", "api_script:app", "--host", "0.0.0.0", "--port", "8000"]
|