rexcloaa commited on
Commit
728b673
·
verified ·
1 Parent(s): 683f2a9

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +30 -10
Dockerfile CHANGED
@@ -1,15 +1,35 @@
1
- FROM golang:1.21-alpine AS builder
 
 
2
  WORKDIR /app
3
- RUN apk add git make && git clone https://github.com/bincooo/chatgpt-adapter.git .
 
 
4
  RUN make build-linux
5
- FROM alpine:3.19.0
 
 
 
 
 
 
 
6
  WORKDIR /app
7
  COPY --from=builder /app/bin/linux/server ./server
8
- COPY --from=builder /app/bin/config.yaml ./config.yaml
9
  RUN chmod +x server
10
- RUN mkdir -p /app/log && chmod 777 /app/log
11
- ENV PORT 7860
12
- # 安装curl用于保持活跃
13
- RUN apk add --no-cache curl
14
- # 启动服务器并保持活跃
15
- CMD ["sh", "-c", "./server --port $PORT & while true; do curl -s http://localhost:$PORT > /dev/null; sleep 1800; done"]
 
 
 
 
 
 
 
 
 
 
1
+ FROM golang:1.23-alpine AS builder
2
+
3
+ # 构建执行文件
4
  WORKDIR /app
5
+ RUN apk add git make && git clone https://github.com/bincooo/chatgpt-adapter.git -b main .
6
+ RUN make install
7
+ # RUN make
8
  RUN make build-linux
9
+ # RUN make build-osx
10
+ # RUN make build-win
11
+
12
+ FROM ubuntu:latest
13
+
14
+ RUN apt update \
15
+ && apt-get install -y curl unzip wget gnupg2 tree
16
+
17
  WORKDIR /app
18
  COPY --from=builder /app/bin/linux/server ./server
19
+ ADD config.yaml .
20
  RUN chmod +x server
21
+
22
+ # Install google
23
+ RUN wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | apt-key add - \
24
+ && echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
25
+ && apt-get update \
26
+ && apt-get install -y google-chrome-stable
27
+ RUN google-chrome-stable --version
28
+
29
+ # 下载过盾文件
30
+ RUN curl -JLO https://raw.githubusercontent.com/bincooo/chatgpt-adapter/refs/heads/hel/bin.zip
31
+ RUN unzip bin.zip && tree .
32
+ RUN mkdir log && chmod -R 777 /app
33
+ ENV ARG "--port 7860"
34
+ CMD ["./server ${ARG}"]
35
+ ENTRYPOINT ["sh", "-c"]