1 Star 0 Fork 0

pluto / Go_Gateway_Dashboard_Back

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dockerfile 740 Bytes
一键复制 编辑 原始数据 按行查看 历史
pluto 提交于 2023-01-10 20:14 . update dockerfile
# 使用与开发时版本匹配的基础镜像
FROM golang:1.17-alpine AS build
# 设置工作路径
WORKDIR /go/src/app
# 项目整体拷贝
COPY . .
#原始方式:直接镜像内打包编译
RUN export GO111MODULE=auto && export GOPROXY=https://goproxy.cn && go mod tidy
# 编译go源代码 并命名为go_gateway 存放到 /bin/go_gateway
RUN CGO_ENABLED=0 GOOS=linux go build -o ./bin/go_gateway
FROM alpine
WORKDIR /
# 更换镜像源 配置时区
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && apk update && apk add tzdata
COPY --from=build /go/src/app/conf /conf
COPY --from=build /go/src/app/bin/go_gateway /go_gateway
# 暴露端口
EXPOSE 8880
# 执行
ENTRYPOINT ["/go_gateway"]
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/chx2333/go_gateway.git
git@gitee.com:chx2333/go_gateway.git
chx2333
go_gateway
Go_Gateway_Dashboard_Back
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891