1 Star 0 Fork 1

lvpx/beyond

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
article-api.dockerfile 857 Bytes
一键复制 编辑 原始数据 按行查看 历史
周老实 提交于 2023-12-17 14:46 . lesson 14
FROM golang:alpine AS builder
LABEL stage=gobuilder
ENV CGO_ENABLED 0
ENV GOPROXY https://goproxy.cn,direct
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update --no-cache && apk add --no-cache tzdata
WORKDIR /build
ADD go.mod .
ADD go.sum .
RUN go mod download
COPY . .
COPY application/article/api/etc/article-api-dev.yaml /app/etc/article-api.yaml
RUN go build -ldflags="-s -w" -o /app/article-api application/article/api/article.go
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai
ENV TZ Asia/Shanghai
WORKDIR /app
COPY --from=builder /app/article-api /app/article-api
COPY --from=builder /app/etc /app/etc
CMD ["./article-api", "-f", "etc/article-api.yaml"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lvpeixin/beyond.git
git@gitee.com:lvpeixin/beyond.git
lvpeixin
beyond
beyond
main

搜索帮助