File size: 585 Bytes
cac1531
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
c1017a7
dc7d6a0
c1017a7
cac1531
 
 
 
 
 
 
 
 
 
 
0c0fa0b
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
FROM node:18-slim

# 安装 Chrome 依赖
RUN apt-get update && apt-get install -y \
    wget \
    gnupg \
    ca-certificates \
    procps \
    chromium \
    chromium-sandbox \
    git

RUN git clone https://github.com/xLmiler/grok2api.git /app

# 设置工作目录
WORKDIR app

RUN sed -i 's/\/v1\/chat\/completions/\/hf\/v1\/chat\/completions/g' index.js
RUN sed -i 's/\/v1\/models/\/hf\/v1\/models/g' index.js

# 安装依赖
RUN npm install

# 设置环境变量
ENV CHROME_PATH=/usr/bin/chromium
ENV PORT=7860

# 暴露端口
EXPOSE 7860

# 启动应用
CMD ["npm", "start"]