File size: 1,037 Bytes
c301538
 
075c5a0
c301538
 
 
 
 
 
 
075c5a0
c301538
 
 
075c5a0
c301538
 
075c5a0
c301538
075c5a0
 
 
 
 
 
c301538
 
 
 
 
075c5a0
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
# 使用 Debian 系 Python 镜像,避开 Chainguard 的 apk/openssl 冲突
FROM python:3.13-slim

# 安装系统依赖:Nginx、Supervisor 及编译 LiteLLM 可能需要的工具
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
    nginx \
    supervisor \
    curl \
    && rm -rf /var/lib/apt/lists/*

# 安装 LiteLLM Proxy
# 注意:此处版本号需与你所需的安全版本对应,PyPI 版本可能与镜像标签不完全一致
RUN pip install --no-cache-dir "litellm[proxy]==1.83.14"

# 清理 Nginx 默认站点,避免冲突
RUN rm -f /etc/nginx/sites-enabled/default

# 复制你的配置文件
COPY litellm-config.yaml /app/config.yaml
COPY nginx.conf /etc/nginx/conf.d/litellm.conf
COPY supervisord.conf /etc/supervisor/conf.d/litellm-nginx.conf
COPY index.html /usr/share/nginx/html/index.html

WORKDIR /app

# Nginx 对外暴露 80,LiteLLM 4000 仅内部使用
EXPOSE 10080

# 用 Supervisor 管理两个进程
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/supervisord.conf", "-n"]