作者 yangfu

base image

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
FROM alpine:latest
# Define the project name | 定义项目名称
ARG PROJECT=core
# Define the config file name | 定义配置文件名
ARG CONFIG_FILE=core-dev.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/chart-server/api/etc/${CONFIG_FILE} ./etc/
EXPOSE 8080
ENTRYPOINT ./${PROJECT} -f etc/${CONFIG_FILE}
\ No newline at end of file
... ...
... ... @@ -57,6 +57,6 @@ func main() {
db.Migrate(ctx.DB)
logx.Infof("Starting server at %s:%d...\n", c.Host, c.Port)
logx.Infof("Starting server at %s:%d... \n", c.Host, c.Port)
server.Start()
}
... ...
... ... @@ -127,10 +127,12 @@ type Quarter struct {
YAxisFirstLabel string `json:"yAxisFirstLabel"` // y标签1
YAxisSecondLabel string `json:"yAxisSecondLabel"` // y标签2
Area string `json:"area"` // 图形面积
AreaColor bool `json:"areaColor"` // 颜色
SeriesList []QuarterSeries `json:"seriesList"` // 图形系列
}
type QuarterSeries struct {
SeriesValue string `json:"seriesValue"`
}
type Title struct {
... ...
... ... @@ -37,9 +37,12 @@ type Quarter struct {
YAxisFirstLabel string `json:"yAxisFirstLabel"` // y标签1
YAxisSecondLabel string `json:"yAxisSecondLabel"` // y标签2
Area string `json:"area"` // 图形面积
AreaColor bool `json:"areaColor"` // 颜色
SeriesList []QuarterSeries `json:"seriesList"` // 图形系列
}
type QuarterSeries struct {
SeriesValue string `json:"seriesValue"`
}
type Title struct {
... ...
... ... @@ -170,9 +170,11 @@ type(
YAxisFirstLabel string `json:"yAxisFirstLabel"` // y标签1
YAxisSecondLabel string `json:"yAxisSecondLabel"` // y标签2
Area string `json:"area"` // 图形面积
AreaColor bool `json:"areaColor"` // 颜色
SeriesList []QuarterSeries `json:"seriesList"` // 图形系列
}
QuarterSeries struct {
SeriesValue string `json:"seriesValue"`
}
Title struct {
TitleSwitch bool `json:"titleSwitch,optional"` // 组件标题开关
... ...