nj2a / Dockerfile
tmpublic's picture
Upload 4 files
189b5b2 verified
FROM python:3.11-slim
# 安装系统依赖
RUN apt-get update && apt-get install -y \
curl \
gnupg \
lsb-release \
ca-certificates \
iproute2 \
iptables \
dbus \
&& rm -rf /var/lib/apt/lists/*
# 安装 Cloudflare WARP
RUN curl -fsSL https://pkg.cloudflareclient.com/pubkey.gpg | gpg --yes --dearmor -o /usr/share/keyrings/cloudflare-warp-archive-keyring.gpg \
&& echo "deb [arch=amd64 signed-by=/usr/share/keyrings/cloudflare-warp-archive-keyring.gpg] https://pkg.cloudflareclient.com/ bookworm main" > /etc/apt/sources.list.d/cloudflare-client.list \
&& apt-get update \
&& apt-get install -y cloudflare-warp \
&& rm -rf /var/lib/apt/lists/*
# 创建 WARP 数据目录
RUN mkdir -p /var/lib/cloudflare-warp
# 创建工作目录
WORKDIR /app
# 复制依赖文件
COPY requirements.txt .
# 安装 Python 依赖
RUN pip install --no-cache-dir -r requirements.txt
# 复制应用代码
COPY ww.py .
COPY start.sh .
# 设置启动脚本权限
RUN chmod +x start.sh
# HuggingFace Space 使用 7860 端口
EXPOSE 7860
# 启动脚本
CMD ["./start.sh"]