adapter / Dockerfile
deeme's picture
Upload Dockerfile
d7dc51c verified
raw
history blame contribute delete
546 Bytes
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"]