Cwhd2 commited on
Commit
e5bfa32
·
verified ·
1 Parent(s): 4adef7d

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +29 -3
Dockerfile CHANGED
@@ -1,6 +1,32 @@
1
- # 继承自官方发布的最新预构建镜像
2
  FROM ghcr.io/jiujiu532/grok2api:latest
3
 
4
- # Hugging Face 强制要求容器监听 7860 端口
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  ENV SERVER_PORT=7860
6
- EXPOSE 7860
 
 
 
 
 
 
 
 
 
1
  FROM ghcr.io/jiujiu532/grok2api:latest
2
 
3
+ # 安装必要工具 (curl 用于下载, grep 用于解析,ca-certificates 用于 https 连接)
4
+ USER root
5
+ RUN apt-get update && apt-get install -y --no-install-recommends \
6
+ curl \
7
+ ca-certificates \
8
+ grep \
9
+ && rm -rf /var/lib/apt/lists/*
10
+
11
+ # 自动获取并安装最新版 wgcf (Cloudflare WARP 账号生成器)
12
+ RUN DOWNLOAD_URL=$(curl -fsSL https://api.github.com/repos/ViRb3/wgcf/releases/latest | grep 'browser_download_url' | cut -d'"' -f4 | grep "linux_amd64") && \
13
+ curl -Lo /usr/local/bin/wgcf "$DOWNLOAD_URL" && \
14
+ chmod +x /usr/local/bin/wgcf
15
+
16
+ # 自动获取并安装最新版 wireproxy (用户态 WireGuard 客户端)
17
+ RUN DOWNLOAD_URL=$(curl -fsSL https://api.github.com/repos/octeep/wireproxy/releases/latest | grep 'browser_download_url' | cut -d'"' -f4 | grep "linux_amd64.tar.gz") && \
18
+ curl -Lo /tmp/wireproxy.tar.gz "$DOWNLOAD_URL" && \
19
+ tar -xzf /tmp/wireproxy.tar.gz -C /usr/local/bin/ wireproxy && \
20
+ chmod +x /usr/local/bin/wireproxy && \
21
+ rm -f /tmp/wireproxy.tar.gz
22
+
23
+ # 声明 HF 容器必需的端口
24
  ENV SERVER_PORT=7860
25
+ EXPOSE 7860
26
+
27
+ # 复制启动脚本
28
+ COPY entrypoint.sh /entrypoint.sh
29
+ RUN chmod +x /entrypoint.sh
30
+
31
+ # 设置启动入口
32
+ ENTRYPOINT ["/entrypoint.sh"]