186 Star 2.1K Fork 753

dromara/mayfly-go

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Dockerfile.sourcebuild 862 Bytes
一键复制 编辑 原始数据 按行查看 历史
Coder慌 提交于 2024-10-31 17:24 . refactor: 前端文件夹名称调整
# 构建前端资源
FROM m.daocloud.io/docker.io/node:18-bookworm-slim as fe-builder
WORKDIR /mayfly
COPY frontend .
RUN yarn config set registry 'https://registry.npmmirror.com' && \
yarn install && \
yarn build
# 构建后端资源
FROM m.daocloud.io/docker.io/golang:1.23 as be-builder
ENV GOPROXY https://goproxy.cn
WORKDIR /mayfly
# Copy the go source for building server
COPY server .
RUN go mod tidy && go mod download
COPY --from=fe-builder /mayfly/dist /mayfly/static/static
# Build
RUN GO111MODULE=on CGO_ENABLED=0 GOOS=linux \
go build -a -ldflags=-w \
-o mayfly-go main.go
FROM m.daocloud.io/docker.io/alpine:3.20.2
ARG TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
WORKDIR /mayfly-go
COPY --from=be-builder /mayfly/mayfly-go /usr/local/bin/mayfly-go
CMD ["mayfly-go"]
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/dromara/mayfly-go.git
git@gitee.com:dromara/mayfly-go.git
dromara
mayfly-go
mayfly-go
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385