1 Star 0 Fork 62

陈泽 / simple-admin-core

forked from 几颗酥 / simple-admin-core 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
Dockerfile-api 971 Bytes
一键复制 编辑 原始数据 按行查看 历史
几颗酥 提交于 2023-07-25 11:23 . chore: update all in one
FROM golang:1.20.6-alpine3.17 as builder
# Define the project name | 定义项目名称
ARG PROJECT=core
WORKDIR /build
COPY . .
RUN go env -w GO111MODULE=on \
&& go env -w GOPROXY=https://goproxy.cn,direct \
&& go env -w CGO_ENABLED=0 \
&& go env \
&& go mod tidy \
&& cd api \
&& go build -ldflags="-s -w" -o /build/api/${PROJECT}_api ${PROJECT}.go
FROM alpine:latest
# Define the project name | 定义项目名称
ARG PROJECT=core
# Define the config file name | 定义配置文件名
ARG CONFIG_FILE=core.yaml
# Define the author | 定义作者
ARG AUTHOR=yuansu.china.work@gmail.com
LABEL org.opencontainers.image.authors=${AUTHOR}
WORKDIR /app
ENV PROJECT=${PROJECT}
ENV CONFIG_FILE=${CONFIG_FILE}
COPY --from=builder /build/api/${PROJECT}_api ./
COPY --from=builder /build/api/etc/${CONFIG_FILE} ./etc/
COPY --from=builder /build/api/internal/i18n/locale/ ./etc/locale/
EXPOSE 9100
ENTRYPOINT ./${PROJECT}_api -f etc/${CONFIG_FILE}
Go
1
https://gitee.com/c7787504/simple-admin-core.git
git@gitee.com:c7787504/simple-admin-core.git
c7787504
simple-admin-core
simple-admin-core
master

搜索帮助