作者 tangxvhui

添加dockerfile

FROM golang:1.19-alpine 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 cmd/discuss/api \
&& go build -ldflags="-s -w" -o /build/api/${PROJECT} ${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=785409885@qq.com
LABEL org.opencontainers.image.authors=${AUTHOR}
WORKDIR /app
ENV PROJECT=${PROJECT}
ENV CONFIG_FILE=${CONFIG_FILE}
COPY --from=builder /build/api/${PROJECT} ./
COPY --from=builder /build/cmd/discuss/api/etc/${CONFIG_FILE} ./etc/
EXPOSE 8080
ENTRYPOINT ./${PROJECT} -f etc/${CONFIG_FILE}
\ No newline at end of file
... ...
... ... @@ -99,5 +99,6 @@ func (l *SystemUserInfoLogic) SystemUserInfo(req *types.SystemUserInfoRequest) (
// 后台登录时 ,检查/设置公司的初始数据
func (l *SystemUserInfoLogic) initSystemData(companyId int64) error {
// TODO 初始设置文章标签
return nil
}
... ...
... ... @@ -33,6 +33,8 @@ func (repository *ArticleTagRepository) Insert(ctx context.Context, conn transac
}
// func (repository *ArticleTagRepository) CreateInBatches
func (repository *ArticleTagRepository) Update(ctx context.Context, conn transaction.Conn, dm *domain.ArticleTag) (*domain.ArticleTag, error) {
var (
err error
... ...