1 Star 2 Fork 3

韦清河/copilot-gpt4-service

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.02 KB
一键复制 编辑 原始数据 按行查看 历史
Geniucker 提交于 2024-01-25 16:27 . ci: better cache
FROM --platform=$BUILDPLATFORM golang:alpine as builder
ARG TARGETPLATFORM
ARG BUILDPLATFORM
ENV CGO_ENABLED=0 GOOS=linux
WORKDIR /app
COPY . .
RUN --mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg \
apk add --update-cache ca-certificates tzdata && \
rm -rf /var/cache/apk/* && \
\
go mod download && \
\
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
go build -o copilot-gpt4-service .; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
GOARCH=arm64 go build -o copilot-gpt4-service .; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
GOARCH=arm go build -o copilot-gpt4-service .; \
else \
echo "Unsupported platform: $TARGETPLATFORM"; \
exit 1; \
fi
FROM scratch
WORKDIR /app
COPY --from=builder /app/copilot-gpt4-service .
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
EXPOSE 8080
ENTRYPOINT ["./copilot-gpt4-service"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/weiqh2000/copilot-gpt4-service.git
[email protected]:weiqh2000/copilot-gpt4-service.git
weiqh2000
copilot-gpt4-service
copilot-gpt4-service
master

搜索帮助