作者 庄敏学
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/chart-server/api \
&& go build -ldflags="-s -w" -o /build/api/${PROJECT} ${PROJECT}.go
\ No newline at end of file
... ... @@ -19,7 +19,7 @@ FROM alpine:latest
# Define the project name | 定义项目名称
ARG PROJECT=core
# Define the config file name | 定义配置文件名
ARG CONFIG_FILE=core-dev.yaml
ARG CONFIG_FILE=core-prd.yaml
# Define the author | 定义作者
ARG AUTHOR=785409885@qq.com
... ... @@ -31,6 +31,7 @@ ENV CONFIG_FILE=${CONFIG_FILE}
COPY --from=builder /build/api/${PROJECT} ./
COPY --from=builder /build/cmd/chart-server/api/etc/${CONFIG_FILE} ./etc/
COPY --from=builder /build/cmd/chart-server/api/public ./public/
EXPOSE 8080
ENTRYPOINT ./${PROJECT} -f etc/${CONFIG_FILE}
\ No newline at end of file
... ...
Name: chart
Host: 0.0.0.0
Port: 8080
Verbose: false
HostName: http://sumifcc-bchart.sumifcc.com
Log:
Mode: file
Encoding: plain
Level: info
JwtAuth:
AccessSecret: digital-platform
Expire: 360000
Redis:
Host: 192.168.0.243:6379
Type: node
Pass:
DB:
DataSource: host=114.55.200.59 user=postgres password=eagle1010 dbname=sumifcc-bchart port=31543 sslmode=disable TimeZone=Asia/Shanghai
ByteMetadata:
Name: ApiByteMetadata
Host: https://character-library-metadata-bastion.sumifcc.com
Timeout: 0s
\ No newline at end of file
... ...
... ... @@ -40,7 +40,7 @@ type TableQueryWhere struct {
}
func (w *TableQueryWhere) WithPageSize(page, size int) *TableQueryWhere {
w.PageNumber = page - 1
w.PageNumber = page
w.PageSize = size
if page == 0 {
w.PageNumber = 0
... ...