rexcloaa commited on
Commit
8aa8abc
·
verified ·
1 Parent(s): 73ecf41

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -9
Dockerfile CHANGED
@@ -1,20 +1,15 @@
1
  FROM golang:1.21-alpine AS builder
2
  WORKDIR /app
3
- RUN apk add git make && git clone https://github.com/reccea/chatgpt-adapter.git .
4
  RUN make build-linux
5
-
6
- # 编译代理服务器
7
- COPY proxy.go .
8
- RUN go build -o proxy proxy.go
9
  FROM alpine:3.19.0
10
  WORKDIR /app
11
  COPY --from=builder /app/bin/linux/server ./server
12
  COPY --from=builder /app/bin/config.yaml ./config.yaml
13
- COPY --from=builder /app/proxy ./proxy
14
- RUN chmod +x server proxy
15
  RUN mkdir -p /app/log && chmod 777 /app/log
16
  ENV PORT 7860
17
  # 安装curl用于保持活跃
18
  RUN apk add --no-cache curl
19
- # 启动代理服务器并保持活跃
20
- CMD ["sh", "-c", "./proxy & while true; do curl -s http://localhost:$PORT > /dev/null; sleep 1800; done"]
 
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"]