Gk2a / Dockerfile
hfga's picture
Update Dockerfile
2ad947f verified
raw
history blame
585 Bytes
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"]