1 Star 0 Fork 9

王孜(lao/CoGPT

forked from guanty18/CoGPT 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile 1.08 KB
一键复制 编辑 原始数据 按行查看 历史
Geniucker 提交于 2024-02-01 16:51 . fix: fix Dockerfile
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,sharing=locked \
--mount=type=cache,target=/go/pkg,sharing=locked \
apk add --update-cache ca-certificates tzdata make && \
go mod download && \
\
if [ "$TARGETPLATFORM" = "linux/amd64" ]; then \
make cogpt-api args1="GOARCH=amd64" args="-o cogpt-api"; \
elif [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
make cogpt-api args1="GOARCH=arm64" args="-o cogpt-api"; \
elif [ "$TARGETPLATFORM" = "linux/arm/v7" ]; then \
make cogpt-api args1="GOARCH=arm" args="-o cogpt-api"; \
else \
echo "Unsupported platform: $TARGETPLATFORM"; \
exit 1; \
fi
FROM scratch
WORKDIR /app
COPY --from=builder /app/cogpt-api /app/cogpt-api
COPY --from=builder /usr/share/zoneinfo /usr/share/zoneinfo
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
EXPOSE 8080
VOLUME ["/app/db", "/app/log"]
ENTRYPOINT ["./cogpt-api"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/wa-zing/CoGPT.git
git@gitee.com:wa-zing/CoGPT.git
wa-zing
CoGPT
CoGPT
main

搜索帮助

0d507c66 1850385 C8b1a773 1850385