Spaces:
Build error
Build error
File size: 916 Bytes
c9052d1 059f166 c9052d1 3e7b48f c9052d1 3e7b48f 0e6604e 981c72a df054a5 981c72a 603a887 1bafb9c 919ea52 d8ffda1 3784add 652bc73 d8ffda1 c9052d1 981c72a |
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 |
# 使用基础镜像 ollama/ollama:latest
FROM ollama/ollama:latest
# 执行 apt 更新和安装 python3 和 pip3
RUN apt update && apt install -y python3 && apt install -y python3-pip
# 安装 litellm 和 litellm[proxy],指定豆瓣镜像源
RUN pip3 install litellm
RUN pip3 install 'litellm[proxy]'
# Create a directory for Ollama data
RUN mkdir -p /.ollama
RUN chmod -R 777 /.ollama
WORKDIR /.ollama
# Copy the entry point script
COPY config.yaml /config.yaml
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENV SERVER_ROOT_PATH="/api"
EXPOSE 4000
EXPOSE 7860
EXPOSE 11434
EXPOSE 443
# 设置启动命令(踩坑记录:CMD无法覆盖ollama/ollama镜像的ENTRYPOINT,导致一致报错,改用ENTRYPOINT就可以解决)
# CMD ["litellm", "--model", "ollama/deepseek-llm:67b-chat"]
# 设置ENTRYPOINT
# ENTRYPOINT ["litellm", "--model", "ollama/mistral:7b"]
ENTRYPOINT ["/entrypoint.sh"] |