|
|
|
FROM golang AS builder |
|
|
|
|
|
ENV GO111MODULE=on \ |
|
CGO_ENABLED=0 \ |
|
GOOS=linux |
|
|
|
|
|
WORKDIR /build |
|
|
|
|
|
RUN apt-get update && apt-get install -y git |
|
|
|
|
|
RUN git clone https://github.com/deanxv/coze-discord-proxy.git . |
|
|
|
RUN sed -i 's|router.Group("/v1")|router.Group("/hf/v1")|g' router/api-router.go |
|
|
|
|
|
RUN go mod download |
|
RUN go build -o /coze-discord-proxy |
|
|
|
|
|
FROM alpine |
|
|
|
|
|
RUN apk --no-cache add ca-certificates tzdata |
|
|
|
|
|
COPY --from=builder /coze-discord-proxy . |
|
|
|
|
|
EXPOSE 7077 |
|
|
|
|
|
WORKDIR /app/coze-discord-proxy/data |
|
COPY entrypoint.sh /app/coze-discord-proxy/data |
|
|
|
|
|
RUN mkdir -p /app/coze-discord-proxy/data/config && chmod 777 -R /app |
|
|
|
|
|
ENTRYPOINT ["./entrypoint.sh"] |
|
|
|
|
|
CMD ["/coze-discord-proxy"] |