File size: 546 Bytes
d68466c d7dc51c d68466c 02200fc d68466c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
FROM golang:1.23-alpine AS builder
# 构建执行文件
WORKDIR /app
RUN apk add git make && git clone https://github.com/bincooo/chatgpt-adapter.git .
RUN make install
RUN CGO_ENABLED=0 GOARCH=amd64 GOOS=linux go build -toolexec iocgo -ldflags="-s -w" -o bin/linux/server -trimpath main.go
FROM alpine:latest
WORKDIR /app
COPY --from=builder /app/bin/linux/server ./server
ADD config.yaml .
RUN chmod +x server \
&& mkdir log && chmod 777 log \
&& mkdir tmp && chmod 777 tmp
CMD ["./server"]
ENTRYPOINT ["sh", "-c"] |