litellm / Dockerfile
zhengr's picture
Update Dockerfile
652bc73 verified
raw
history blame
886 Bytes
# 使用基础镜像 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 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"]